This is guix.zh_CN.info, produced by makeinfo version 6.7 from guix.zh_CN.texi. Copyright © 2012-2022 Ludovic Courtès Copyright © 2013, 2014, 2016 Andreas Enge Copyright © 2013 Nikita Karetnikov Copyright © 2014, 2015, 2016 Alex Kost Copyright © 2015, 2016 Mathieu Lirzin Copyright © 2014 Pierre-Antoine Rault Copyright © 2015 Taylan Ulrich Bayırlı/Kammer Copyright © 2015, 2016, 2017, 2019, 2020, 2021 Leo Famulari Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus Copyright © 2016 Ben Woodcroft Copyright © 2016, 2017, 2018, 2021 Chris Marusich Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner Copyright © 2016 John Darrington Copyright © 2016, 2017 Nikita Gillmann Copyright © 2016, 2017, 2018, 2019, 2020 Jan Nieuwenhuizen Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Julien Lepiller Copyright © 2016 Alex ter Weele Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Christopher Baines Copyright © 2017, 2018, 2019 Clément Lassieur Copyright © 2017, 2018, 2020, 2021, 2022 Mathieu Othacehe Copyright © 2017 Federico Beffa Copyright © 2017, 2018 Carlo Zancanaro Copyright © 2017 Thomas Danckaert Copyright © 2017 humanitiesNerd Copyright © 2017, 2021 Christine Lemmer-Webber Copyright © 2017, 2018, 2019, 2020, 2021, 2022 Marius Bakke Copyright © 2017, 2019, 2020, 2022 Hartmut Goebel Copyright © 2017, 2019, 2020, 2021, 2022 Maxim Cournoyer Copyright © 2017–2022 Tobias Geerinckx-Rice Copyright © 2017 George Clemmer Copyright © 2017 Andy Wingo Copyright © 2017, 2018, 2019, 2020 Arun Isaac Copyright © 2017 nee Copyright © 2018 Rutger Helling Copyright © 2018, 2021 Oleg Pykhalov Copyright © 2018 Mike Gerwitz Copyright © 2018 Pierre-Antoine Rouby Copyright © 2018, 2019 Gábor Boskovits Copyright © 2018, 2019, 2020, 2022 Florian Pelz Copyright © 2018 Laura Lazzati Copyright © 2018 Alex Vong Copyright © 2019 Josh Holland Copyright © 2019, 2020 Diego Nicola Barbato Copyright © 2019 Ivan Petkov Copyright © 2019 Jakob L. Kreuze Copyright © 2019 Kyle Andrews Copyright © 2019 Alex Griffin Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant Copyright © 2020 Liliana Marie Prikler Copyright © 2019, 2020, 2021, 2022 Simon Tournier Copyright © 2020 Wiktor Żelazny Copyright © 2020 Damien Cassou Copyright © 2020 Jakub Kądziołka Copyright © 2020 Jack Hill Copyright © 2020 Naga Malleswari Copyright © 2020, 2021 Brice Waegeneire Copyright © 2020 R Veera Kumar Copyright © 2020, 2021 Pierre Langlois Copyright © 2020 pinoaffe Copyright © 2020 André Batista Copyright © 2020, 2021 Alexandru-Sergiu Marton Copyright © 2020 raingloom Copyright © 2020 Daniel Brooks Copyright © 2020 John Soo Copyright © 2020 Jonathan Brielmaier Copyright © 2020 Edgar Vincent Copyright © 2021, 2022 Maxime Devos Copyright © 2021 B. Wilson Copyright © 2021 Xinglu Chen Copyright © 2021 Raghav Gururajan Copyright © 2021 Domagoj Stolfa Copyright © 2021 Hui Lu Copyright © 2021 pukkamustard Copyright © 2021 Alice Brenon Copyright © 2021, 2022 Josselin Poiret Copyright © 2021 muradm Copyright © 2021, 2022 Andrew Tropin Copyright © 2021 Sarah Morgensen Copyright © 2022 Remco van ’t Veer Copyright © 2022 Aleksandr Vityazev Copyright © 2022 Philip M^{c}Grath Copyright © 2022 Karl Hallsby Copyright © 2022 Justin Veilleux Copyright © 2022 Reily Siegel Copyright © 2022 Simon Streit Copyright © 2022 ( Copyright © 2022 John Kehayias Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”. INFO-DIR-SECTION 系统管理 START-INFO-DIR-ENTRY * Guix:(guix). 管理安装的软件和系统配置。 * guix package:调用guix package. 安装、删除和升级软件包。 * guix gc:调用guix gc. 回收不使用的硬盘空间。 * guix pull:调用guix pull. 更新可用的软件包列表。 * guix system:调用guix system. 管理操作系统配置。 * guix deploy: (guix)Invoking guix deploy. Manage operating system configurations for remote hosts. END-INFO-DIR-ENTRY INFO-DIR-SECTION 软件开发 START-INFO-DIR-ENTRY * guix shell: (guix)Invoking guix shell. Creating software environments. * guix environment:调用guix environment. 用Guix构建开发环境。 * guix build:(guix)调用guix build. 构建软件包。 * guix pack:(guix)调用guix pack. 创建二进制bundle。 END-INFO-DIR-ENTRY  File: guix.zh_CN.info, Node: 定义服务, Prev: 在虚拟机里运行Guix, Up: 系统配置 12.18 定义服务 ============== The previous sections show the available services and how one can combine them in an ‘operating-system’ declaration. But how do we define them in the first place? And what is a service anyway? * Menu: * 合成服务:: 服务合成的模型。 * 服务类型和服务:: 类型和服务。 * 服务参考:: API参考。 * Shepherd服务:: 一种特别的服务。 * Complex Configurations:: Defining bindings for complex configurations.  File: guix.zh_CN.info, Node: 合成服务, Next: 服务类型和服务, Up: 定义服务 12.18.1 合成服务 ---------------- Here we define a “service” as, broadly, something that extends the functionality of the operating system. Often a service is a process—a “daemon”—started when the system boots: a secure shell server, a Web server, the Guix build daemon, etc. Sometimes a service is a daemon whose execution can be triggered by another daemon—e.g., an FTP server started by ‘inetd’ or a D-Bus service activated by ‘dbus-daemon’. Occasionally, a service does not map to a daemon. For instance, the “account” service collects user accounts and makes sure they exist when the system runs; the “udev” service collects device management rules and makes them available to the eudev daemon; the ‘/etc’ service populates the ‘/etc’ directory of the system. Guix system services are connected by “extensions”. For instance, the secure shell service _extends_ the Shepherd—the initialization system, running as PID 1—by giving it the command lines to start and stop the secure shell daemon (*note ‘openssh-service-type’: 网络服务.); the UPower service extends the D-Bus service by passing it its ‘.service’ specification, and extends the udev service by passing it device management rules (*note ‘upower-service’: 桌面服务.); the Guix daemon service extends the Shepherd by passing it the command lines to start and stop the daemon, and extends the account service by passing it a list of required build user accounts (*note 基础服务::). All in all, services and their “extends” relations form a directed acyclic graph (DAG). If we represent services as boxes and extensions as arrows, a typical system might provide something like this: [image src="images/service-graph.png" alt="Typical service extension graph."] At the bottom, we see the “system service”, which produces the directory containing everything to run and boot the system, as returned by the ‘guix system build’ command. *Note 服务参考::, to learn about the other service types shown here. *Note the ‘guix system extension-graph’ command: system-extension-graph, for information on how to generate this representation for a particular operating system definition. Technically, developers can define “service types” to express these relations. There can be any number of services of a given type on the system—for instance, a system running two instances of the GNU secure shell server (lsh) has two instances of ‘lsh-service-type’, with different parameters. The following section describes the programming interface for service types and services.  File: guix.zh_CN.info, Node: 服务类型和服务, Next: 服务参考, Prev: 合成服务, Up: 定义服务 12.18.2 服务类型和服务 ---------------------- A “service type” is a node in the DAG described above. Let us start with a simple example, the service type for the Guix build daemon (*note 调用guix-daemon::): (define guix-service-type (service-type (name 'guix) (extensions (list (service-extension shepherd-root-service-type guix-shepherd-service) (service-extension account-service-type guix-accounts) (service-extension activation-service-type guix-activation))) (default-value (guix-configuration)))) It defines three things: 1. A name, whose sole purpose is to make inspection and debugging easier. 2. A list of “service extensions”, where each extension designates the target service type and a procedure that, given the parameters of the service, returns a list of objects to extend the service of that type. Every service type has at least one service extension. The only exception is the “boot service type”, which is the ultimate service. 3. Optionally, a default value for instances of this type. In this example, ‘guix-service-type’ extends three services: ‘shepherd-root-service-type’ The ‘guix-shepherd-service’ procedure defines how the Shepherd service is extended. Namely, it returns a ‘’ object that defines how ‘guix-daemon’ is started and stopped (*note Shepherd服务::). ‘account-service-type’ This extension for this service is computed by ‘guix-accounts’, which returns a list of ‘user-group’ and ‘user-account’ objects representing the build user accounts (*note 调用guix-daemon::). ‘activation-service-type’ Here ‘guix-activation’ is a procedure that returns a gexp, which is a code snippet to run at “activation time”—e.g., when the service is booted. A service of this type is instantiated like this: (service guix-service-type (guix-configuration (build-accounts 5) (extra-options '("--gc-keep-derivations")))) The second argument to the ‘service’ form is a value representing the parameters of this specific service instance. *Note ‘guix-configuration’: guix-configuration-type, for information about the ‘guix-configuration’ data type. When the value is omitted, the default value specified by ‘guix-service-type’ is used: (service guix-service-type) ‘guix-service-type’ is quite simple because it extends other services but is not extensible itself. The service type for an _extensible_ service looks like this: (define udev-service-type (service-type (name 'udev) (extensions (list (service-extension shepherd-root-service-type udev-shepherd-service))) (compose concatenate) ;concatenate the list of rules (extend (lambda (config rules) (match config (($ udev initial-rules) (udev-configuration (udev udev) ;the udev package to use (rules (append initial-rules rules))))))))) This is the service type for the eudev device management daemon (https://wiki.gentoo.org/wiki/Project:Eudev). Compared to the previous example, in addition to an extension of ‘shepherd-root-service-type’, we see two new fields: ‘compose’ This is the procedure to “compose” the list of extensions to services of this type. Services can extend the udev service by passing it lists of rules; we compose those extensions simply by concatenating them. ‘extend’ This procedure defines how the value of the service is “extended” with the composition of the extensions. Udev extensions are composed into a list of rules, but the udev service value is itself a ‘’ record. So here, we extend that record by appending the list of rules it contains to the list of contributed rules. ‘description’ This is a string giving an overview of the service type. The string can contain Texinfo markup (*note (texinfo)Overview::). The ‘guix system search’ command searches these strings and displays them (*note 调用guix system::). There can be only one instance of an extensible service type such as ‘udev-service-type’. If there were more, the ‘service-extension’ specifications would be ambiguous. Still here? The next section provides a reference of the programming interface for services.  File: guix.zh_CN.info, Node: 服务参考, Next: Shepherd服务, Prev: 服务类型和服务, Up: 定义服务 12.18.3 服务参考 ---------------- We have seen an overview of service types (*note 服务类型和服务::). This section provides a reference on how to manipulate services and service types. This interface is provided by the ‘(gnu services)’ module. -- Scheme Procedure: service TYPE [VALUE] Return a new service of TYPE, a ‘’ object (see below). VALUE can be any object; it represents the parameters of this particular service instance. When VALUE is omitted, the default value specified by TYPE is used; if TYPE does not specify a default value, an error is raised. For instance, this: (service openssh-service-type) is equivalent to this: (service openssh-service-type (openssh-configuration)) In both cases the result is an instance of ‘openssh-service-type’ with the default configuration. -- Scheme Procedure: service? OBJ Return true if OBJ is a service. -- Scheme Procedure: service-kind SERVICE Return the type of SERVICE—i.e., a ‘’ object. -- Scheme Procedure: service-value SERVICE Return the value associated with SERVICE. It represents its parameters. Here is an example of how a service is created and manipulated: (define s (service nginx-service-type (nginx-configuration (nginx nginx) (log-directory log-directory) (run-directory run-directory) (file config-file)))) (service? s) ⇒ #t (eq? (service-kind s) nginx-service-type) ⇒ #t The ‘modify-services’ form provides a handy way to change the parameters of some of the services of a list such as ‘%base-services’ (*note ‘%base-services’: 基础服务.). It evaluates to a list of services. Of course, you could always use standard list combinators such as ‘map’ and ‘fold’ to do that (*note List Library: (guile)SRFI-1.); ‘modify-services’ simply provides a more concise form for this common pattern. -- Scheme Syntax: modify-services SERVICES (TYPE VARIABLE => BODY) ... Modify the services listed in SERVICES according to the given clauses. Each clause has the form: (TYPE VARIABLE => BODY) where TYPE is a service type—e.g., ‘guix-service-type’—and VARIABLE is an identifier that is bound within the BODY to the service parameters—e.g., a ‘guix-configuration’ instance—of the original service of that TYPE. The BODY should evaluate to the new service parameters, which will be used to configure the new service. This new service will replace the original in the resulting list. Because a service’s service parameters are created using ‘define-record-type*’, you can write a succinct BODY that evaluates to the new service parameters by using the ‘inherit’ feature that ‘define-record-type*’ provides. Clauses can also have the following form: (delete TYPE) Such a clause removes all services of the given TYPE from SERVICES. *Note 使用配置系统::, for example usage. Next comes the programming interface for service types. This is something you want to know when writing new service definitions, but not necessarily when simply looking for ways to customize your ‘operating-system’ declaration. -- Data Type: service-type This is the representation of a “service type” (*note 服务类型和服务::). ‘名字’ This is a symbol, used only to simplify inspection and debugging. ‘extensions’ A non-empty list of ‘’ objects (see below). ‘compose’ (default: ‘#f’) If this is ‘#f’, then the service type denotes services that cannot be extended—i.e., services that do not receive “values” from other services. Otherwise, it must be a one-argument procedure. The procedure is called by ‘fold-services’ and is passed a list of values collected from extensions. It may return any single value. ‘extend’ (default: ‘#f’) If this is ‘#f’, services of this type cannot be extended. Otherwise, it must be a two-argument procedure: ‘fold-services’ calls it, passing it the initial value of the service as the first argument and the result of applying ‘compose’ to the extension values as the second argument. It must return a value that is a valid parameter value for the service instance. ‘description’ This is a string, possibly using Texinfo markup, describing in a couple of sentences what the service is about. This string allows users to find about the service through ‘guix system search’ (*note 调用guix system::). ‘default-value’ (default: ‘&no-default-value’) The default value associated for instances of this service type. This allows users to use the ‘service’ form without its second argument: (service TYPE) The returned service in this case has the default value specified by TYPE. *Note 服务类型和服务::, for examples. -- Scheme Procedure: service-extension TARGET-TYPE COMPUTE Return a new extension for services of type TARGET-TYPE. COMPUTE must be a one-argument procedure: ‘fold-services’ calls it, passing it the value associated with the service that provides the extension; it must return a valid value for the target service. -- Scheme Procedure: service-extension? OBJ Return true if OBJ is a service extension. Occasionally, you might want to simply extend an existing service. This involves creating a new service type and specifying the extension of interest, which can be verbose; the ‘simple-service’ procedure provides a shorthand for this. -- Scheme Procedure: simple-service NAME TARGET VALUE Return a service that extends TARGET with VALUE. This works by creating a singleton service type NAME, of which the returned service is an instance. For example, this extends mcron (*note 执行计划任务::) with an additional job: (simple-service 'my-mcron-job mcron-service-type #~(job '(next-hour (3)) "guix gc -F 2G")) At the core of the service abstraction lies the ‘fold-services’ procedure, which is responsible for “compiling” a list of services down to a single directory that contains everything needed to boot and run the system—the directory shown by the ‘guix system build’ command (*note 调用guix system::). In essence, it propagates service extensions down the service graph, updating each node parameters on the way, until it reaches the root node. -- Scheme Procedure: fold-services SERVICES [#:target-type SYSTEM-SERVICE-TYPE] Fold SERVICES by propagating their extensions down to the root of type TARGET-TYPE; return the root service adjusted accordingly. Lastly, the ‘(gnu services)’ module also defines several essential service types, some of which are listed below. -- Scheme Variable: system-service-type This is the root of the service graph. It produces the system directory as returned by the ‘guix system build’ command. -- Scheme Variable: boot-service-type The type of the “boot service”, which produces the “boot script”. The boot script is what the initial RAM disk runs when booting. -- Scheme Variable: etc-service-type The type of the ‘/etc’ service. This service is used to create files under ‘/etc’ and can be extended by passing it name/file tuples such as: (list `("issue" ,(plain-file "issue" "Welcome!\n"))) In this example, the effect would be to add an ‘/etc/issue’ file pointing to the given file. -- Scheme Variable: setuid-program-service-type Type for the “setuid-program service”. This service collects lists of executable file names, passed as gexps, and adds them to the set of setuid and setgid programs on the system (*note setuid程序::). -- Scheme Variable: profile-service-type Type of the service that populates the “system profile”—i.e., the programs under ‘/run/current-system/profile’. Other services can extend it by passing it lists of packages to add to the system profile. -- Scheme Variable: provenance-service-type This is the type of the service that records “provenance meta-data” in the system itself. It creates several files under ‘/run/current-system’: ‘channels.scm’ This is a “channel file” that can be passed to ‘guix pull -C’ or ‘guix time-machine -C’, and which describes the channels used to build the system, if that information was available (*note 通道::). ‘configuration.scm’ This is the file that was passed as the value for this ‘provenance-service-type’ service. By default, ‘guix system reconfigure’ automatically passes the OS configuration file it received on the command line. ‘provenance’ This contains the same information as the two other files but in a format that is more readily processable. In general, these two pieces of information (channels and configuration file) are enough to reproduce the operating system “from source”. Caveats: This information is necessary to rebuild your operating system, but it is not always sufficient. In particular, ‘configuration.scm’ itself is insufficient if it is not self-contained—if it refers to external Guile modules or to extra files. If you want ‘configuration.scm’ to be self-contained, we recommend that modules or files it refers to be part of a channel. Besides, provenance meta-data is “silent” in the sense that it does not change the bits contained in your system, _except for the meta-data bits themselves_. Two different OS configurations or sets of channels can lead to the same system, bit-for-bit; when ‘provenance-service-type’ is used, these two systems will have different meta-data and thus different store file names, which makes comparison less trivial. This service is automatically added to your operating system configuration when you use ‘guix system reconfigure’, ‘guix system init’, or ‘guix deploy’. -- Scheme Variable: linux-loadable-module-service-type Type of the service that collects lists of packages containing kernel-loadable modules, and adds them to the set of kernel-loadable modules. This service type is intended to be extended by other service types, such as below: (simple-service 'installing-module linux-loadable-module-service-type (list module-to-install-1 module-to-install-2)) This does not actually load modules at bootup, only adds it to the kernel profile so that it _can_ be loaded by other means.  File: guix.zh_CN.info, Node: Shepherd服务, Next: Complex Configurations, Prev: 服务参考, Up: 定义服务 12.18.4 Shepherd服务 -------------------- The ‘(gnu services shepherd)’ module provides a way to define services managed by the GNU Shepherd, which is the initialization system—the first process that is started when the system boots, also known as PID 1 (*note (shepherd)介绍::). Services in the Shepherd can depend on each other. For instance, the SSH daemon may need to be started after the syslog daemon has been started, which in turn can only happen once all the file systems have been mounted. The simple operating system defined earlier (*note 使用配置系统::) results in a service graph like this: [image src="images/shepherd-graph.png" alt="Typical shepherd service graph."] You can actually generate such a graph for any operating system definition using the ‘guix system shepherd-graph’ command (*note ‘guix system shepherd-graph’: system-shepherd-graph.). The ‘%shepherd-root-service’ is a service object representing PID 1, of type ‘shepherd-root-service-type’; it can be extended by passing it lists of ‘’ objects. -- Data Type: shepherd-service The data type representing a service managed by the Shepherd. ‘provision’ This is a list of symbols denoting what the service provides. These are the names that may be passed to ‘herd start’, ‘herd status’, and similar commands (*note (shepherd)Invoking herd::). *Note the ‘provides’ slot: (shepherd)Slots of services, for details. ‘requirement’ (default: ‘'()’) List of symbols denoting the Shepherd services this one depends on. ‘one-shot?’ (default: ‘#f’) Whether this service is “one-shot”. One-shot services stop immediately after their ‘start’ action has completed. *Note (shepherd)Slots of services::, for more info. ‘respawn?’ (default: ‘#t’) Whether to restart the service when it stops, for instance when the underlying process dies. ‘start’ ‘stop’ (default: ‘#~(const #f)’) The ‘start’ and ‘stop’ fields refer to the Shepherd’s facilities to start and stop processes (*note (shepherd)Service De- and Constructors::). They are given as G-expressions that get expanded in the Shepherd configuration file (*note G-表达式::). ‘actions’ (default: ‘'()’) This is a list of ‘shepherd-action’ objects (see below) defining “actions” supported by the service, in addition to the standard ‘start’ and ‘stop’ actions. Actions listed here become available as ‘herd’ sub-commands: herd ACTION SERVICE [ARGUMENTS...] ‘auto-start?’ (default: ‘#t’) Whether this service should be started automatically by the Shepherd. If it is ‘#f’ the service has to be started manually with ‘herd start’. ‘documentation’ A documentation string, as shown when running: herd doc SERVICE-NAME where SERVICE-NAME is one of the symbols in ‘provision’ (*note (shepherd)Invoking herd::). ‘modules’ (default: ‘%default-modules’) This is the list of modules that must be in scope when ‘start’ and ‘stop’ are evaluated. The example below defines a Shepherd service that spawns ‘syslogd’, the system logger from the GNU Networking Utilities (*note ‘syslogd’: (inetutils)syslogd invocation.): (let ((config (plain-file "syslogd.conf" "..."))) (shepherd-service (documentation "Run the syslog daemon (syslogd).") (provision '(syslogd)) (requirement '(user-processes)) (start #~(make-forkexec-constructor (list #$(file-append inetutils "/libexec/syslogd") "--rcfile" #$config) #:pid-file "/var/run/syslog.pid")) (stop #~(make-kill-destructor)))) Key elements in this example are the ‘start’ and ‘stop’ fields: they are “staged” code snippets that use the ‘make-forkexec-constructor’ procedure provided by the Shepherd and its dual, ‘make-kill-destructor’ (*note (shepherd)Service De- and Constructors::). The ‘start’ field will have ‘shepherd’ spawn ‘syslogd’ with the given option; note that we pass ‘config’ after ‘--rcfile’, which is a configuration file declared above (contents of this file are omitted). Likewise, the ‘stop’ field tells how this service is to be stopped; in this case, it is stopped by making the ‘kill’ system call on its PID. Code staging is achieved using G-expressions: ‘#~’ stages code, while ‘#$’ “escapes” back to host code (*note G-表达式::). -- Data Type: shepherd-action This is the data type that defines additional actions implemented by a Shepherd service (see above). ‘名字’ Symbol naming the action. ‘documentation’ This is a documentation string for the action. It can be viewed by running: herd doc SERVICE action ACTION ‘procedure’ This should be a gexp that evaluates to a procedure of at least one argument, which is the “running value” of the service (*note (shepherd)Slots of services::). The following example defines an action called ‘say-hello’ that kindly greets the user: (shepherd-action (name 'say-hello) (documentation "Say hi!") (procedure #~(lambda (running . args) (format #t "Hello, friend! arguments: ~s\n" args) #t))) Assuming this action is added to the ‘example’ service, then you can do: # herd say-hello example Hello, friend! arguments: () # herd say-hello example a b c Hello, friend! arguments: ("a" "b" "c") This, as you can see, is a fairly sophisticated way to say hello. *Note (shepherd)Service Convenience::, for more info on actions. -- Scheme Procedure: shepherd-configuration-action Return a ‘configuration’ action to display FILE, which should be the name of the service’s configuration file. It can be useful to equip services with that action. For example, the service for the Tor anonymous router (*note ‘tor-service-type’: 网络服务.) is defined roughly like this: (let ((torrc (plain-file "torrc" ...))) (shepherd-service (provision '(tor)) (requirement '(user-processes loopback syslogd)) (start #~(make-forkexec-constructor (list #$(file-append tor "/bin/tor") "-f" #$torrc) #:user "tor" #:group "tor")) (stop #~(make-kill-destructor)) (actions (list (shepherd-configuration-action torrc))) (documentation "Run the Tor anonymous network overlay."))) Thanks to this action, administrators can inspect the configuration file passed to ‘tor’ with this shell command: cat $(herd configuration tor) This can come in as a handy debugging tool! -- Scheme Variable: shepherd-root-service-type The service type for the Shepherd “root service”—i.e., PID 1. This is the service type that extensions target when they want to create shepherd services (*note 服务类型和服务::, for an example). Each extension must pass a list of ‘’. Its value must be a ‘shepherd-configuration’, as described below. -- Data Type: shepherd-configuration This data type represents the Shepherd’s configuration. ‘shepherd (default: shepherd)’ The Shepherd package to use. ‘services (default: '())’ A list of ‘’ to start. You should probably use the service extension mechanism instead (*note Shepherd服务::). The following example specifies the Shepherd package for the operating system: (operating-system ;; ... (services (append (list openssh-service-type)) ;; ... %desktop-services) ;; ... ;; Use own Shepherd package. (essential-services (modify-services (operating-system-default-essential-services this-operating-system) (shepherd-root-service-type config => (shepherd-configuration (inherit config) (shepherd my-shepherd)))))) -- Scheme Variable: %shepherd-root-service This service represents PID 1.  File: guix.zh_CN.info, Node: Complex Configurations, Prev: Shepherd服务, Up: 定义服务 12.18.5 Complex Configurations ------------------------------ Some programs might have rather complex configuration files or formats, and to make it easier to create Scheme bindings for these configuration files, you can use the utilities defined in the ‘(gnu services configuration)’ module. The main utility is the ‘define-configuration’ macro, which you will use to define a Scheme record type (*note (guile)Record Overview::). The Scheme record will be serialized to a configuration file by using “serializers”, which are procedures that take some kind of Scheme value and returns a G-expression (*note G-表达式::), which should, once serialized to the disk, return a string. More details are listed below. -- Scheme Syntax: define-configuration NAME CLAUSE1 CLAUSE2 ... Create a record type named ‘NAME’ that contains the fields found in the clauses. A clause can have one of the following forms: (FIELD-NAME (TYPE DEFAULT-VALUE) DOCUMENTATION) (FIELD-NAME (TYPE DEFAULT-VALUE) DOCUMENTATION SERIALIZER) (FIELD-NAME (TYPE) DOCUMENTATION) (FIELD-NAME (TYPE) DOCUMENTATION SERIALIZER) FIELD-NAME is an identifier that denotes the name of the field in the generated record. TYPE is the type of the value corresponding to FIELD-NAME; since Guile is untyped, a predicate procedure—‘TYPE?’—will be called on the value corresponding to the field to ensure that the value is of the correct type. This means that if say, TYPE is ‘package’, then a procedure named ‘package?’ will be applied on the value to make sure that it is indeed a ‘’ object. DEFAULT-VALUE is the default value corresponding to the field; if none is specified, the user is forced to provide a value when creating an object of the record type. DOCUMENTATION is a string formatted with Texinfo syntax which should provide a description of what setting this field does. SERIALIZER is the name of a procedure which takes two arguments, the first is the name of the field, and the second is the value corresponding to the field. The procedure should return a string or G-expression (*note G-表达式::) that represents the content that will be serialized to the configuration file. If none is specified, a procedure of the name ‘serialize-TYPE’ will be used. A simple serializer procedure could look like this: (define (serialize-boolean field-name value) (let ((value (if value "true" "false"))) #~(string-append #$field-name #$value))) In some cases multiple different configuration records might be defined in the same file, but their serializers for the same type might have to be different, because they have different configuration formats. For example, the ‘serialize-boolean’ procedure for the Getmail service would have to be different from the one for the Transmission service. To make it easier to deal with this situation, one can specify a serializer prefix by using the ‘prefix’ literal in the ‘define-configuration’ form. This means that one doesn’t have to manually specify a custom SERIALIZER for every field. (define (foo-serialize-string field-name value) ...) (define (bar-serialize-string field-name value) ...) (define-configuration foo-configuration (label (string) "The name of label.") (prefix foo-)) (define-configuration bar-configuration (ip-address (string) "The IPv4 address for this device.") (prefix bar-)) However, in some cases you might not want to serialize any of the values of the record, to do this, you can use the ‘no-serialization’ literal. There is also the ‘define-configuration/no-serialization’ macro which is a shorthand of this. ;; Nothing will be serialized to disk. (define-configuration foo-configuration (field (string "test") "Some documentation.") (no-serialization)) ;; The same thing as above. (define-configuration/no-serialization bar-configuration (field (string "test") "Some documentation.")) -- Scheme Syntax: define-maybe TYPE Sometimes a field should not be serialized if the user doesn’t specify a value. To achieve this, you can use the ‘define-maybe’ macro to define a “maybe type”; if the value of a maybe type is left unset, or is set to the ‘%unset-value’ value, then it will not be serialized. When defining a “maybe type”, the corresponding serializer for the regular type will be used by default. For example, a field of type ‘maybe-string’ will be serialized using the ‘serialize-string’ procedure by default, you can of course change this by specifying a custom serializer procedure. Likewise, the type of the value would have to be a string, or left unspecified. (define-maybe string) (define (serialize-string field-name value) ...) (define-configuration baz-configuration (name ;; If set to a string, the `serialize-string' procedure will be used ;; to serialize the string. Otherwise this field is not serialized. maybe-string "The name of this module.")) Like with ‘define-configuration’, one can set a prefix for the serializer name by using the ‘prefix’ literal. (define-maybe integer (prefix baz-)) (define (baz-serialize-integer field-name value) ...) There is also the ‘no-serialization’ literal, which when set means that no serializer will be defined for the “maybe type”, regardless of whether its value is set or not. ‘define-maybe/no-serialization’ is a shorthand for specifying the ‘no-serialization’ literal. (define-maybe/no-serialization symbol) (define-configuration/no-serialization test-configuration (mode maybe-symbol "Docstring.")) -- (Scheme: Procedure) maybe-value-set? VALUE Predicate to check whether a user explicitly specified the value of a maybe field. -- Scheme Procedure: serialize-configuration CONFIGURATION FIELDS Return a G-expression that contains the values corresponding to the FIELDS of CONFIGURATION, a record that has been generated by ‘define-configuration’. The G-expression can then be serialized to disk by using something like ‘mixed-text-file’. -- Scheme Procedure: empty-serializer FIELD-NAME VALUE A serializer that just returns an empty string. The ‘serialize-package’ procedure is an alias for this. Once you have defined a configuration record, you will most likely also want to document it so that other people know to use it. To help with that, there are two procedures, both of which are documented below. -- Scheme Procedure: generate-documentation DOCUMENTATION DOCUMENTATION-NAME Generate a Texinfo fragment from the docstrings in DOCUMENTATION, a list of ‘(LABEL FIELDS SUB-DOCUMENTATION ...)’. LABEL should be a symbol and should be the name of the configuration record. FIELDS should be a list of all the fields available for the configuration record. SUB-DOCUMENTATION is a ‘(FIELD-NAME CONFIGURATION-NAME)’ tuple. FIELD-NAME is the name of the field which takes another configuration record as its value, and CONFIGURATION-NAME is the name of that configuration record. SUB-DOCUMENTATION is only needed if there are nested configuration records. For example, the ‘getmail-configuration’ record (*note 邮件服务::) accepts a ‘getmail-configuration-file’ record in one of its ‘rcfile’ field, therefore documentation for ‘getmail-configuration-file’ is nested in ‘getmail-configuration’. (generate-documentation `((getmail-configuration ,getmail-configuration-fields (rcfile getmail-configuration-file)) ...) 'getmail-configuration) DOCUMENTATION-NAME should be a symbol and should be the name of the configuration record. -- Scheme Procedure: configuration->documentation CONFIGURATION-SYMBOL Take CONFIGURATION-SYMBOL, the symbol corresponding to the name used when defining a configuration record with ‘define-configuration’, and print the Texinfo documentation of its fields. This is useful if there aren’t any nested configuration records since it only prints the documentation for the top-level fields. As of right now, there is no automated way to generate documentation for configuration records and put them in the manual. Instead, every time you make a change to the docstrings of a configuration record, you have to manually call ‘generate-documentation’ or ‘configuration->documentation’, and paste the output into the ‘doc/guix.texi’ file. Below is an example of a record type created using ‘define-configuration’ and friends. (use-modules (gnu services) (guix gexp) (gnu services configuration) (srfi srfi-26) (srfi srfi-1)) ;; Turn field names, which are Scheme symbols into strings (define (uglify-field-name field-name) (let ((str (symbol->string field-name))) ;; field? -> is-field (if (string-suffix? "?" str) (string-append "is-" (string-drop-right str 1)) str))) (define (serialize-string field-name value) #~(string-append #$(uglify-field-name field-name) " = " #$value "\n")) (define (serialize-integer field-name value) (serialize-string field-name (number->string value))) (define (serialize-boolean field-name value) (serialize-string field-name (if value "true" "false"))) (define (serialize-contact-name field-name value) #~(string-append "\n[" #$value "]\n")) (define (list-of-contact-configurations? lst) (every contact-configuration? lst)) (define (serialize-list-of-contact-configurations field-name value) #~(string-append #$@(map (cut serialize-configuration <> contact-configuration-fields) value))) (define (serialize-contacts-list-configuration configuration) (mixed-text-file "contactrc" #~(string-append "[Owner]\n" #$(serialize-configuration configuration contacts-list-configuration-fields)))) (define-maybe integer) (define-maybe string) (define-configuration contact-configuration (name (string) "The name of the contact." serialize-contact-name) (phone-number maybe-integer "The person's phone number.") (email maybe-string "The person's email address.") (married? (boolean) "Whether the person is married.")) (define-configuration contacts-list-configuration (name (string) "The name of the owner of this contact list.") (email (string) "The owner's email address.") (contacts (list-of-contact-configurations '()) "A list of @code{contact-configuation} records which contain information about all your contacts.")) A contacts list configuration could then be created like this: (define my-contacts (contacts-list-configuration (name "Alice") (email "alice@example.org") (contacts (list (contact-configuration (name "Bob") (phone-number 1234) (email "bob@gnu.org") (married? #f)) (contact-configuration (name "Charlie") (phone-number 0000) (married? #t)))))) After serializing the configuration to disk, the resulting file would look like this: [owner] name = Alice email = alice@example.org [Bob] phone-number = 1234 email = bob@gnu.org is-married = false [Charlie] phone-number = 0 is-married = true  File: guix.zh_CN.info, Node: Home Configuration, Next: 文档, Prev: 系统配置, Up: Top 13 Home Configuration ********************* Guix supports declarative configuration of “home environments” by utilizing the configuration mechanism described in the previous chapter (*note 定义服务::), but for user’s dotfiles and packages. It works both on Guix System and foreign distros and allows users to declare all the packages and services that should be installed and configured for the user. Once a user has written a file containing ‘home-environment’ record, such a configuration can be “instantiated” by an unprivileged user with the ‘guix home’ command (*note Invoking guix home::). 注: The functionality described in this section is still under development and is subject to change. Get in touch with us on ! The user’s home environment usually consists of three basic parts: software, configuration, and state. Software in mainstream distros are usually installed system-wide, but with GNU Guix most software packages can be installed on a per-user basis without needing root privileges, and are thus considered part of the user’s “home environment”. Packages on their own are not very useful in many cases, because often they require some additional configuration, usually config files that reside in ‘XDG_CONFIG_HOME’ (‘~/.config’ by default) or other directories. Everything else can be considered state, like media files, application databases, and logs. Using Guix for managing home environments provides a number of advantages: • All software can be configured in one language (Guile Scheme), this gives users the ability to share values between configurations of different programs. • A well-defined home environment is self-contained and can be created in a declarative and reproducible way—there is no need to grab external binaries or manually edit some configuration file. • After every ‘guix home reconfigure’ invocation, a new home environment generation will be created. This means that users can rollback to a previous home environment generation so they don’t have to worry about breaking their configuration. • It is possible to manage stateful data with Guix Home, this includes the ability to automatically clone Git repositories on the initial setup of the machine, and periodically running commands like ‘rsync’ to sync data with another host. This functionality is still in an experimental stage, though. * Menu: * Declaring the Home Environment:: Customizing your Home. * Configuring the Shell:: Enabling home environment. * Home Services:: Specifying home services. * Invoking guix home:: Instantiating a home configuration.  File: guix.zh_CN.info, Node: Declaring the Home Environment, Next: Configuring the Shell, Up: Home Configuration 13.1 Declaring the Home Environment =================================== The home environment is configured by providing a ‘home-environment’ declaration in a file that can be passed to the ‘guix home’ command (*note Invoking guix home::). The easiest way to get started is by generating an initial configuration with ‘guix home import’: guix home import ~/src/guix-config The ‘guix home import’ command reads some of the “dot files” such as ‘~/.bashrc’ found in your home directory and copies them to the given directory, ‘~/src/guix-config’ in this case; it also reads the contents of your profile, ‘~/.guix-profile’, and, based on that, it populates ‘~/src/guix-config/home-configuration.scm’ with a Home configuration that resembles your current configuration. A simple setup can include Bash and a custom text configuration, like in the example below. Don’t be afraid to declare home environment parts, which overlaps with your current dot files: before installing any configuration files, Guix Home will back up existing config files to a separate place in the home directory. 注: It is highly recommended that you manage your shell or shells with Guix Home, because it will make sure that all the necessary scripts are sourced by the shell configuration file. Otherwise you will need to do it manually. (*note Configuring the Shell::). (use-modules (gnu home) (gnu home services) (gnu home services shells) (gnu services) (gnu packages admin) (guix gexp)) (home-environment (packages (list htop)) (services (list (service home-bash-service-type (home-bash-configuration (guix-defaults? #t) (bash-profile (list (plain-file "bash-profile" "\ export HISTFILE=$XDG_CACHE_HOME/.bash_history"))))) (simple-service 'test-config home-xdg-configuration-files-service-type (list `("test.conf" ,(plain-file "tmp-file.txt" "the content of ~/.config/test.conf"))))))) The ‘packages’ field should be self-explanatory, it will install the list of packages into the user’s profile. The most important field is ‘services’, it contains a list of “home services”, which are the basic building blocks of a home environment. There is no daemon (at least not necessarily) related to a home service, a home service is just an element that is used to declare part of home environment and extend other parts of it. The extension mechanism discussed in the previous chapter (*note 定义服务::) should not be confused with Shepherd services (*note Shepherd服务::). Using this extension mechanism and some Scheme code that glues things together gives the user the freedom to declare their own, very custom, home environments. Once the configuration looks good, you can first test it in a throw-away “container”: guix home container config.scm The command above spawns a shell where your home environment is running. The shell runs in a container, meaning it’s isolated from the rest of the system, so it’s a good way to try out your configuration—you can see if configuration bits are missing or misbehaving, if daemons get started, and so on. Once you exit that shell, you’re back to the prompt of your original shell “in the real world”. Once you have a configuration file that suits your needs, you can reconfigure your home by running: guix home reconfigure config.scm This “builds” your home environment and creates ‘~/.guix-home’ pointing to it. Voilà! 注: Make sure the operating system has elogind, systemd, or a similar mechanism to create the XDG run-time directory and has the ‘XDG_RUNTIME_DIR’ variable set. Failing that, the ‘on-first-login’ script will not execute anything, and processes like user Shepherd and its descendants will not start.  File: guix.zh_CN.info, Node: Configuring the Shell, Next: Home Services, Prev: Declaring the Home Environment, Up: Home Configuration 13.2 Configuring the Shell ========================== This section is safe to skip if your shell or shells are managed by Guix Home. Otherwise, read it carefully. There are a few scripts that must be evaluated by a login shell to activate the home environment. The shell startup files only read by login shells often have ‘profile’ suffix. For more information about login shells see *note (bash)Invoking Bash:: and see *note (bash)Bash Startup Files::. The first script that needs to be sourced is ‘setup-environment’, which sets all the necessary environment variables (including variables declared by the user) and the second one is ‘on-first-login’, which starts Shepherd for the current user and performs actions declared by other home services that extends ‘home-run-on-first-login-service-type’. Guix Home will always create ‘~/.profile’, which contains the following lines: HOME_ENVIRONMENT=$HOME/.guix-home . $HOME_ENVIRONMENT/setup-environment $HOME_ENVIRONMENT/on-first-login This makes POSIX compliant login shells activate the home environment. However, in most cases this file won’t be read by most modern shells, because they are run in non POSIX mode by default and have their own ‘*profile’ startup files. For example Bash will prefer ‘~/.bash_profile’ in case it exists and only if it doesn’t will it fallback to ‘~/.profile’. Zsh (if no additional options are specified) will ignore ‘~/.profile’, even if ‘~/.zprofile’ doesn’t exist. To make your shell respect ‘~/.profile’, add ‘. ~/.profile’ or ‘source ~/.profile’ to the startup file for the login shell. In case of Bash, it is ‘~/.bash_profile’, and in case of Zsh, it is ‘~/.zprofile’. 注: This step is only required if your shell is _not_ managed by Guix Home. Otherwise, everything will be done automatically.  File: guix.zh_CN.info, Node: Home Services, Next: Invoking guix home, Prev: Configuring the Shell, Up: Home Configuration 13.3 Home Services ================== A “home service” is not necessarily something that has a daemon and is managed by Shepherd (*note (shepherd)Jump Start::), in most cases it doesn’t. It’s a simple building block of the home environment, often declaring a set of packages to be installed in the home environment profile, a set of config files to be symlinked into ‘XDG_CONFIG_HOME’ (‘~/.config’ by default), and environment variables to be set by a login shell. There is a service extension mechanism (*note 合成服务::) which allows home services to extend other home services and utilize capabilities they provide; for example: declare mcron jobs (*note (mcron)Top::) by extending *note Mcron Home Service::; declare daemons by extending *note Shepherd Home Service::; add commands, which will be invoked on by the Bash by extending *note ‘home-bash-service-type’: Shells Home Services. A good way to discover available home services is using the ‘guix home search’ command (*note Invoking guix home::). After the required home services are found, include its module with the ‘use-modules’ form (*note Using Guile Modules: (guile)use-modules.), or the ‘#:use-modules’ directive (*note Creating Guile Modules: (guile)define-module.) and declare a home service using the ‘service’ function, or extend a service type by declaring a new service with the ‘simple-service’ procedure from ‘(gnu services)’. * Menu: * Essential Home Services:: Environment variables, packages, on-* scripts. * Shells: Shells Home Services. POSIX shells, Bash, Zsh. * Mcron: Mcron Home Service. Scheduled User’s Job Execution. * Power Management: Power Management Home Services. Services for battery power. * Shepherd: Shepherd Home Service. Managing User’s Daemons. * SSH: Secure Shell. Setting up the secure shell client. * Desktop: Desktop Home Services. Services for graphical environments. * Guix: Guix Home Services. Services for Guix.  File: guix.zh_CN.info, Node: Essential Home Services, Next: Shells Home Services, Up: Home Services 13.3.1 Essential Home Services ------------------------------ There are a few essential home services defined in ‘(gnu services)’, they are mostly for internal use and are required to build a home environment, but some of them will be useful for the end user. -- Scheme Variable: home-environment-variables-service-type The service of this type will be instantiated by every home environment automatically by default, there is no need to define it, but someone may want to extend it with a list of pairs to set some environment variables. (list ("ENV_VAR1" . "value1") ("ENV_VAR2" . "value2")) The easiest way to extend a service type, without defining a new service type is to use the ‘simple-service’ helper from ‘(gnu services)’. (simple-service 'some-useful-env-vars-service home-environment-variables-service-type `(("LESSHISTFILE" . "$XDG_CACHE_HOME/.lesshst") ("SHELL" . ,(file-append zsh "/bin/zsh")) ("USELESS_VAR" . #f) ("_JAVA_AWT_WM_NONREPARENTING" . #t))) If you include such a service in you home environment definition, it will add the following content to the ‘setup-environment’ script (which is expected to be sourced by the login shell): export LESSHISTFILE=$XDG_CACHE_HOME/.lesshst export SHELL=/gnu/store/2hsg15n644f0glrcbkb1kqknmmqdar03-zsh-5.8/bin/zsh export _JAVA_AWT_WM_NONREPARENTING 注: Make sure that module ‘(gnu packages shells)’ is imported with ‘use-modules’ or any other way, this namespace contains the definition of the ‘zsh’ package, which is used in the example above. The association list (*note alists: (guile)Association Lists.) is a data structure containing key-value pairs, for ‘home-environment-variables-service-type’ the key is always a string, the value can be a string, string-valued gexp (*note G-表达式::), file-like object (*note file-like object: G-表达式.) or boolean. For gexps, the variable will be set to the value of the gexp; for file-like objects, it will be set to the path of the file in the store (*note 仓库::); for ‘#t’, it will export the variable without any value; and for ‘#f’, it will omit variable. -- Scheme Variable: home-profile-service-type The service of this type will be instantiated by every home environment automatically, there is no need to define it, but you may want to extend it with a list of packages if you want to install additional packages into your profile. Other services, which need to make some programs available to the user will also extend this service type. The extension value is just a list of packages: (list htop vim emacs) The same approach as ‘simple-service’ (*note simple-service: 服务参考.) for ‘home-environment-variables-service-type’ can be used here, too. Make sure that modules containing the specified packages are imported with ‘use-modules’. To find a package or information about its module use ‘guix search’ (*note 调用guix package::). Alternatively, ‘specification->package’ can be used to get the package record from string without importing related module. There are few more essential services, but users are not expected to extend them. -- Scheme Variable: home-service-type The root of home services DAG, it generates a folder, which later will be symlinked to ‘~/.guix-home’, it contains configurations, profile with binaries and libraries, and some necessary scripts to glue things together. -- Scheme Variable: home-run-on-first-login-service-type The service of this type generates a Guile script, which is expected to be executed by the login shell. It is only executed if the special flag file inside ‘XDG_RUNTIME_DIR’ hasn’t been created, this prevents redundant executions of the script if multiple login shells are spawned. It can be extended with a gexp. However, to autostart an application, users _should not_ use this service, in most cases it’s better to extend ‘home-shepherd-service-type’ with a Shepherd service (*note Shepherd服务::), or extend the shell’s startup file with the required command using the appropriate service type. -- Scheme Variable: home-files-service-type The service of this type allows to specify a list of files, which will go to ‘~/.guix-home/files’, usually this directory contains configuration files (to be more precise it contains symlinks to files in ‘/gnu/store’), which should be placed in ‘$XDG_CONFIG_DIR’ or in rare cases in ‘$HOME’. It accepts extension values in the following format: `((".sway/config" ,sway-file-like-object) (".tmux.conf" ,(local-file "./tmux.conf"))) Each nested list contains two values: a subdirectory and file-like object. After building a home environment ‘~/.guix-home/files’ will be populated with apropiate content and all nested directories will be created accordingly, however, those files won’t go any further until some other service will do it. By default a ‘home-symlink-manager-service-type’, which creates necessary symlinks in home folder to files from ‘~/.guix-home/files’ and backs up already existing, but clashing configs and other things, is a part of essential home services (enabled by default), but it’s possible to use alternative services to implement more advanced use cases like read-only home. Feel free to experiment and share your results. -- Scheme Variable: home-xdg-configuration-files-service-type The service is very similiar to ‘home-files-service-type’ (and actually extends it), but used for defining files, which will go to ‘~/.guix-home/files/.config’, which will be symlinked to ‘$XDG_CONFIG_DIR’ by ‘home-symlink-manager-service-type’ (for example) during activation. It accepts extension values in the following format: `(("sway/config" ,sway-file-like-object) ;; -> ~/.guix-home/files/.config/sway/config ;; -> $XDG_CONFIG_DIR/sway/config (by symlink-manager) ("tmux/tmux.conf" ,(local-file "./tmux.conf"))) -- Scheme Variable: home-activation-service-type The service of this type generates a guile script, which runs on every ‘guix home reconfigure’ invocation or any other action, which leads to the activation of the home environment. -- Scheme Variable: home-symlink-manager-service-type The service of this type generates a guile script, which will be executed during activation of home environment, and do a few following steps: 1. Reads the content of ‘files/’ directory of current and pending home environments. 2. Cleans up all symlinks created by symlink-manager on previous activation. Also, sub-directories, which become empty also will be cleaned up. 3. Creates new symlinks the following way: It looks ‘files/’ directory (usually defined with ‘home-files-service-type’, ‘home-xdg-configuration-files-service-type’ and maybe some others), takes the files from ‘files/.config/’ subdirectory and put respective links in ‘XDG_CONFIG_DIR’. For example symlink for ‘files/.config/sway/config’ will end up in ‘$XDG_CONFIG_DIR/sway/config’. The rest files in ‘files/’ outside of ‘files/.config/’ subdirectory will be treated slightly different: symlink will just go to ‘$HOME’. ‘files/.some-program/config’ will end up in ‘$HOME/.some-program/config’. 4. If some sub-directories are missing, they will be created. 5. If there is a clashing files on the way, they will be backed up. symlink-manager is a part of essential home services and is enabled and used by default.  File: guix.zh_CN.info, Node: Shells Home Services, Next: Mcron Home Service, Prev: Essential Home Services, Up: Home Services 13.3.2 Shells ------------- Shells play a quite important role in the environment initialization process, you can configure them manually as described in section *note Configuring the Shell::, but the recommended way is to use home services listed below. It’s both easier and more reliable. Each home environment instantiates ‘home-shell-profile-service-type’, which creates a ‘~/.profile’ startup file for all POSIX-compatible shells. This file contains all the necessary steps to properly initialize the environment, but many modern shells like Bash or Zsh prefer their own startup files, that’s why the respective home services (‘home-bash-service-type’ and ‘home-zsh-service-type’) ensure that ‘~/.profile’ is sourced by ‘~/.bash_profile’ and ‘~/.zprofile’, respectively. Shell Profile Service ..................... -- Data Type: home-shell-profile-configuration Available ‘home-shell-profile-configuration’ fields are: ‘profile’ (default: ‘()’) (type: text-config) ‘home-shell-profile’ is instantiated automatically by ‘home-environment’, DO NOT create this service manually, it can only be extended. ‘profile’ is a list of file-like objects, which will go to ‘~/.profile’. By default ‘~/.profile’ contains the initialization code which must be evaluated by the login shell to make home-environment’s profile available to the user, but other commands can be added to the file if it is really necessary. In most cases shell’s configuration files are preferred places for user’s customizations. Extend home-shell-profile service only if you really know what you do. Bash Home Service ................. -- Data Type: home-bash-configuration Available ‘home-bash-configuration’ fields are: ‘package’ (default: ‘bash’) (type: package) The Bash package to use. ‘guix-defaults?’ (default: ‘#t’) (type: boolean) Add sane defaults like reading ‘/etc/bashrc’ and coloring the output of ‘ls’ to the top of the ‘.bashrc’ file. ‘environment-variables’ (default: ‘()’) (type: alist) Association list of environment variables to set for the Bash session. The rules for the ‘home-environment-variables-service-type’ apply here (*note Essential Home Services::). The contents of this field will be added after the contents of the ‘bash-profile’ field. ‘aliases’ (default: ‘()’) (type: alist) Association list of aliases to set for the Bash session. The aliases will be defined after the contents of the ‘bashrc’ field has been put in the ‘.bashrc’ file. The alias will automatically be quoted, so something like this: '(("ls" . "ls -alF")) turns into alias ls="ls -alF" ‘bash-profile’ (default: ‘()’) (type: text-config) List of file-like objects, which will be added to ‘.bash_profile’. Used for executing user’s commands at start of login shell (In most cases the shell started on tty just after login). ‘.bash_login’ won’t be ever read, because ‘.bash_profile’ always present. ‘bashrc’ (default: ‘()’) (type: text-config) List of file-like objects, which will be added to ‘.bashrc’. Used for executing user’s commands at start of interactive shell (The shell for interactive usage started by typing ‘bash’ or by terminal app or any other program). ‘bash-logout’ (default: ‘()’) (type: text-config) List of file-like objects, which will be added to ‘.bash_logout’. Used for executing user’s commands at the exit of login shell. It won’t be read in some cases (if the shell terminates by exec’ing another process for example). You can extend the Bash service by using the ‘home-bash-extension’ configuration record, whose fields must mirror that of ‘home-bash-configuration’ (*note home-bash-configuration::). The contents of the extensions will be added to the end of the corresponding Bash configuration files (*note (bash)Bash Startup Files::. For example, here is how you would define a service that extends the Bash service such that ‘~/.bash_profile’ defines an additional environment variable, ‘PS1’: (define bash-fancy-prompt-service (simple-service 'bash-fancy-prompt home-bash-service-type (home-bash-extension (environment-variables '(("PS1" . "\\u \\wλ ")))))) You would then add ‘bash-fancy-prompt-service’ to the list in the ‘services’ field of your ‘home-environment’. The reference of ‘home-bash-extension’ follows. -- Data Type: home-bash-extension Available ‘home-bash-extension’ fields are: ‘environment-variables’ (default: ‘()’) (type: alist) Additional environment variables to set. These will be combined with the environment variables from other extensions and the base service to form one coherent block of environment variables. ‘aliases’ (default: ‘()’) (type: alist) Additional aliases to set. These will be combined with the aliases from other extensions and the base service. ‘bash-profile’ (default: ‘()’) (type: text-config) Additional text blocks to add to ‘.bash_profile’, which will be combined with text blocks from other extensions and the base service. ‘bashrc’ (default: ‘()’) (type: text-config) Additional text blocks to add to ‘.bashrc’, which will be combined with text blocks from other extensions and the base service. ‘bash-logout’ (default: ‘()’) (type: text-config) Additional text blocks to add to ‘.bash_logout’, which will be combined with text blocks from other extensions and the base service. Zsh Home Service ................ -- Data Type: home-zsh-configuration Available ‘home-zsh-configuration’ fields are: ‘package’ (default: ‘zsh’) (type: package) The Zsh package to use. ‘xdg-flavor?’ (default: ‘#t’) (type: boolean) Place all the configs to ‘$XDG_CONFIG_HOME/zsh’. Makes ‘~/.zshenv’ to set ‘ZDOTDIR’ to ‘$XDG_CONFIG_HOME/zsh’. Shell startup process will continue with ‘$XDG_CONFIG_HOME/zsh/.zshenv’. ‘environment-variables’ (default: ‘()’) (type: alist) Association list of environment variables to set for the Zsh session. ‘zshenv’ (default: ‘()’) (type: text-config) List of file-like objects, which will be added to ‘.zshenv’. Used for setting user’s shell environment variables. Must not contain commands assuming the presence of tty or producing output. Will be read always. Will be read before any other file in ‘ZDOTDIR’. ‘zprofile’ (default: ‘()’) (type: text-config) List of file-like objects, which will be added to ‘.zprofile’. Used for executing user’s commands at start of login shell (In most cases the shell started on tty just after login). Will be read before ‘.zlogin’. ‘zshrc’ (default: ‘()’) (type: text-config) List of file-like objects, which will be added to ‘.zshrc’. Used for executing user’s commands at start of interactive shell (The shell for interactive usage started by typing ‘zsh’ or by terminal app or any other program). ‘zlogin’ (default: ‘()’) (type: text-config) List of file-like objects, which will be added to ‘.zlogin’. Used for executing user’s commands at the end of starting process of login shell. ‘zlogout’ (default: ‘()’) (type: text-config) List of file-like objects, which will be added to ‘.zlogout’. Used for executing user’s commands at the exit of login shell. It won’t be read in some cases (if the shell terminates by exec’ing another process for example).  File: guix.zh_CN.info, Node: Mcron Home Service, Next: Power Management Home Services, Prev: Shells Home Services, Up: Home Services 13.3.3 Scheduled User’s Job Execution ------------------------------------- The ‘(gnu home services mcron)’ module provides an interface to GNU mcron, a daemon to run jobs at scheduled times (*note (mcron)Top::). The information about system’s mcron is applicable here (*note 执行计划任务::), the only difference for home services is that they have to be declared in a ‘home-environment’ record instead of an ‘operating-system’ record. -- Scheme Variable: home-mcron-service-type This is the type of the ‘mcron’ home service, whose value is an ‘home-mcron-configuration’ object. It allows to manage scheduled tasks. This service type can be the target of a service extension that provides additional job specifications (*note 合成服务::). In other words, it is possible to define services that provide additional mcron jobs to run. -- Data Type: home-mcron-configuration Available ‘home-mcron-configuration’ fields are: ‘mcron’ (default: ‘mcron’) (type: file-like) The mcron package to use. ‘jobs’ (default: ‘()’) (type: list-of-gexps) This is a list of gexps (*note G-表达式::), where each gexp corresponds to an mcron job specification (*note mcron job specifications: (mcron)Syntax.). ‘log?’ (default: ‘#t’) (type: boolean) Log messages to standard output. ‘log-format’ (default: ‘"~1@*~a ~a: ~a~%"’) (type: string) ‘(ice-9 format)’ format string for log messages. The default value produces messages like "‘PID NAME: MESSAGE"’ (*note Invoking: (mcron)Invoking mcron.). Each message is also prefixed by a timestamp by GNU Shepherd.  File: guix.zh_CN.info, Node: Power Management Home Services, Next: Shepherd Home Service, Prev: Mcron Home Service, Up: Home Services 13.3.4 Power Management Home Services ------------------------------------- The ‘(gnu home services pm)’ module provides home services pertaining to battery power. -- Scheme Variable: home-batsignal-service-type Service for ‘batsignal’, a program that monitors battery levels and warns the user through desktop notifications when their battery is getting low. You can also configure a command to be run when the battery level passes a point deemed “dangerous”. This service is configured with the ‘home-batsignal-configuration’ record. -- Data Type: home-batsignal-configuration Data type representing the configuration for batsignal. ‘warning-level’ (default: ‘15’) The battery level to send a warning message at. ‘warning-message’ (default: ‘#f’) The message to send as a notification when the battery level reaches the ‘warning-level’. Setting to ‘#f’ uses the default message. ‘critical-level’ (default: ‘5’) The battery level to send a critical message at. ‘critical-message’ (default: ‘#f’) The message to send as a notification when the battery level reaches the ‘critical-level’. Setting to ‘#f’ uses the default message. ‘danger-level’ (default: ‘2’) The battery level to run the ‘danger-command’ at. ‘danger-command’ (default: ‘#f’) The command to run when the battery level reaches the ‘danger-level’. Setting to ‘#f’ disables running the command entirely. ‘full-level’ (default: ‘#f’) The battery level to send a full message at. Setting to ‘#f’ disables sending the full message entirely. ‘full-message’ (default: ‘#f’) The message to send as a notification when the battery level reaches the ‘full-level’. Setting to ‘#f’ uses the default message. ‘batteries’ (default: ‘'()’) The batteries to monitor. Setting to ‘'()’ tries to find batteries automatically. ‘poll-delay’ (default: ‘60’) The time in seconds to wait before checking the batteries again. ‘icon’ (default: ‘#f’) A file-like object to use as the icon for battery notifications. Setting to ‘#f’ disables notification icons entirely. ‘notifications?’ (default: ‘#t’) Whether to send any notifications. ‘notifications-expire?’ (default: ‘#f’) Whether notifications sent expire after a time. ‘notification-command’ (default: ‘#f’) Command to use to send messages. Setting to ‘#f’ sends a notification through ‘libnotify’. ‘ignore-missing?’ (default: ‘#f’) Whether to ignore missing battery errors.  File: guix.zh_CN.info, Node: Shepherd Home Service, Next: Secure Shell, Prev: Power Management Home Services, Up: Home Services 13.3.5 Managing User Daemons ---------------------------- The ‘(gnu home services shepherd)’ module supports the definitions of per-user Shepherd services (*note (shepherd)介绍::). You extend ‘home-shepherd-service-type’ with new services; Guix Home then takes care of starting the ‘shepherd’ daemon for you when you log in, which in turns starts the services you asked for. -- Scheme Variable: home-shepherd-service-type The service type for the userland Shepherd, which allows one to manage long-running processes or one-shot tasks. User’s Shepherd is not an init process (PID 1), but almost all other information described in (*note Shepherd服务::) is applicable here too. This is the service type that extensions target when they want to create shepherd services (*note 服务类型和服务::, for an example). Each extension must pass a list of ‘’. Its value must be a ‘home-shepherd-configuration’, as described below. -- Data Type: home-shepherd-configuration This data type represents the Shepherd’s configuration. ‘shepherd (default: shepherd)’ The Shepherd package to use. ‘auto-start? (default: #t)’ Whether or not to start Shepherd on first login. ‘services (default: '())’ A list of ‘’ to start. You should probably use the service extension mechanism instead (*note Shepherd服务::).  File: guix.zh_CN.info, Node: Secure Shell, Next: Desktop Home Services, Prev: Shepherd Home Service, Up: Home Services 13.3.6 Secure Shell ------------------- The OpenSSH package (https://www.openssh.com) includes a client, the ‘ssh’ command, that allows you to connect to remote machines using the SSH (secure shell) protocol. With the ‘(gnu home services ssh)’ module, you can set up OpenSSH so that it works in a predictable fashion, almost independently of state on the local machine. To do that, you instantiate ‘home-openssh-service-type’ in your Home configuration, as explained below. -- Scheme Variable: home-openssh-service-type This is the type of the service to set up the OpenSSH client. It takes care of several things: • providing a ‘~/.ssh/config’ file based on your configuration so that ‘ssh’ knows about hosts you regularly connect to and their associated parameters; • providing a ‘~/.ssh/authorized_keys’, which lists public keys that the local SSH server, ‘sshd’, may accept to connect to this user account; • optionally providing a ‘~/.ssh/known_hosts’ file so that ‘ssh’ can authenticate hosts you connect to. Here is an example of a service and its configuration that you could add to the ‘services’ field of your ‘home-environment’: (service home-openssh-service-type (home-openssh-configuration (hosts (list (openssh-host (name "ci.guix.gnu.org") (user "charlie")) (openssh-host (name "chbouib") (host-name "chbouib.example.org") (user "supercharlie") (port 10022)))) (authorized-keys (list (local-file "alice.pub"))))) The example above lists two hosts and their parameters. For instance, running ‘ssh chbouib’ will automatically connect to ‘chbouib.example.org’ on port 10022, logging in as user ‘supercharlie’. Further, it marks the public key in ‘alice.pub’ as authorized for incoming connections. The value associated with a ‘home-openssh-service-type’ instance must be a ‘home-openssh-configuration’ record, as describe below. -- Data Type: home-openssh-configuration This is the datatype representing the OpenSSH client and server configuration in one’s home environment. It contains the following fields: ‘hosts’ (default: ‘'()’) A list of ‘openssh-host’ records specifying host names and associated connection parameters (see below). This host list goes into ‘~/.ssh/config’, which ‘ssh’ reads at startup. ‘known-hosts’ (default: ‘*unspecified*’) This must be either: • ‘*unspecified*’, in which case ‘home-openssh-service-type’ leaves it up to ‘ssh’ and to the user to maintain the list of known hosts at ‘~/.ssh/known_hosts’, or • a list of file-like objects, in which case those are concatenated and emitted as ‘~/.ssh/known_hosts’. The ‘~/.ssh/known_hosts’ contains a list of host name/host key pairs that allow ‘ssh’ to authenticate hosts you connect to and to detect possible impersonation attacks. By default, ‘ssh’ updates it in a “TOFU, trust-on-first-use” fashion, meaning that it records the host’s key in that file the first time you connect to it. This behavior is preserved when ‘known-hosts’ is set to ‘*unspecified*’. If you instead provide a list of host keys upfront in the ‘known-hosts’ field, your configuration becomes self-contained and stateless: it can be replicated elsewhere or at another point in time. Preparing this list can be relatively tedious though, which is why ‘*unspecified*’ is kept as a default. ‘authorized-keys’ (default: ‘'()’) This must be a list of file-like objects, each of which containing an SSH public key that should be authorized to connect to this machine. Concretely, these files are concatenated and made available as ‘~/.ssh/authorized_keys’. If an OpenSSH server, ‘sshd’, is running on this machine, then it _may_ take this file into account: this is what ‘sshd’ does by default, but be aware that it can also be configured to ignore it. -- Data Type: openssh-host Available ‘openssh-host’ fields are: ‘name’ (type: string) Name of this host declaration. ‘host-name’ (type: maybe-string) Host name—e.g., ‘"foo.example.org"’ or ‘"192.168.1.2"’. ‘address-family’ (type: address-family) Address family to use when connecting to this host: one of ‘AF_INET’ (for IPv4 only), ‘AF_INET6’ (for IPv6 only), or ‘*unspecified*’ (allowing any address family). ‘identity-file’ (type: maybe-string) The identity file to use—e.g., ‘"/home/charlie/.ssh/id_ed25519"’. ‘port’ (type: maybe-natural-number) TCP port number to connect to. ‘user’ (type: maybe-string) User name on the remote host. ‘forward-x11?’ (default: ‘#f’) (type: boolean) Whether to forward remote client connections to the local X11 graphical display. ‘forward-x11-trusted?’ (default: ‘#f’) (type: boolean) Whether remote X11 clients have full access to the original X11 graphical display. ‘forward-agent?’ (default: ‘#f’) (type: boolean) Whether the authentication agent (if any) is forwarded to the remote machine. ‘compression?’ (default: ‘#f’) (type: boolean) Whether to compress data in transit. ‘proxy-command’ (type: maybe-string) The command to use to connect to the server. As an example, a command to connect via an HTTP proxy at 192.0.2.0 would be: ‘"nc -X connect -x 192.0.2.0:8080 %h %p"’. ‘host-key-algorithms’ (type: maybe-string-list) The list of accepted host key algorithms—e.g., ‘'("ssh-ed25519")’. ‘accepted-key-types’ (type: maybe-string-list) The list of accepted user public key types. ‘extra-content’ (default: ‘""’) (type: raw-configuration-string) Extra content appended as-is to this ‘Host’ block in ‘~/.ssh/config’.  File: guix.zh_CN.info, Node: Desktop Home Services, Next: Guix Home Services, Prev: Secure Shell, Up: Home Services 13.3.7 Desktop Home Services ---------------------------- The ‘(gnu home services desktop)’ module provides services that you may find useful on “desktop” systems running a graphical user environment such as Xorg. -- Scheme Variable: home-redshift-service-type This is the service type for Redshift (https://github.com/jonls/redshift), a program that adjusts the display color temperature according to the time of day. Its associated value must be a ‘home-redshift-configuration’ record, as shown below. A typical configuration, where we manually specify the latitude and longitude, might look like this: (service home-redshift-service-type (home-redshift-configuration (location-provider 'manual) (latitude 35.81) ;northern hemisphere (longitude -0.80))) ;west of Greenwich -- Data Type: home-redshift-configuration Available ‘home-redshift-configuration’ fields are: ‘redshift’ (default: ‘redshift’) (type: file-like) Redshift package to use. ‘location-provider’ (default: ‘geoclue2’) (type: symbol) Geolocation provider—‘'manual’ or ‘'geoclue2’. In the former case, you must also specify the ‘latitude’ and ‘longitude’ fields so Redshift can determine daytime at your place. In the latter case, the Geoclue system service must be running; it will be queried for location information. ‘adjustment-method’ (default: ‘randr’) (type: symbol) Color adjustment method. ‘daytime-temperature’ (default: ‘6500’) (type: integer) Daytime color temperature (kelvins). ‘nighttime-temperature’ (default: ‘4500’) (type: integer) Nighttime color temperature (kelvins). ‘daytime-brightness’ (type: maybe-inexact-number) Daytime screen brightness, between 0.1 and 1.0, or left unspecified. ‘nighttime-brightness’ (type: maybe-inexact-number) Nighttime screen brightness, between 0.1 and 1.0, or left unspecified. ‘latitude’ (type: maybe-inexact-number) Latitude, when ‘location-provider’ is ‘'manual’. ‘longitude’ (type: maybe-inexact-number) Longitude, when ‘location-provider’ is ‘'manual’. ‘dawn-time’ (type: maybe-string) Custom time for the transition from night to day in the morning—‘"HH:MM"’ format. When specified, solar elevation is not used to determine the daytime/nighttime period. ‘dusk-time’ (type: maybe-string) Likewise, custom time for the transition from day to night in the evening. ‘extra-content’ (default: ‘""’) (type: raw-configuration-string) Extra content appended as-is to the Redshift configuration file. Run ‘man redshift’ for more information about the configuration file format. -- Scheme Variable: home-dbus-service-type This is the service type for running a session-specific D-Bus, for unprivileged applications that require D-Bus to be running. -- Data Type: home-dbus-configuration The configuration record for ‘home-dbus-service-type’. ‘dbus’ (default: ‘dbus’) The package providing the ‘/bin/dbus-daemon’ command.  File: guix.zh_CN.info, Node: Guix Home Services, Prev: Desktop Home Services, Up: Home Services 13.3.8 Guix Home Services ------------------------- The ‘(gnu home services guix)’ module provides services for user-specific Guix configuration. -- Scheme Variable: home-channels-service-type This is the service type for managing ‘$XDG_CONFIG_HOME/guix/channels.scm’, the file that controls the channels received on ‘guix pull’ (*note 通道::). Its associated value is a list of ‘channel’ records, defined in the ‘(guix channels)’ module. Generally, it is better to extend this service than to directly configure it, as its default value is the default guix channel(s) defined by ‘%default-channels’. If you configure this service directly, be sure to include a guix channel. *Note Specifying Additional Channels:: and *note Using a Custom Guix Channel:: for more details. A typical extension for adding a channel might look like this: (simple-service 'variant-packages-service home-channels-service-type (list (channel (name 'variant-packages) (url "https://example.org/variant-packages.git"))))  File: guix.zh_CN.info, Node: Invoking guix home, Prev: Home Services, Up: Home Configuration 13.4 Invoking ‘guix home’ ========================= Once you have written a home environment declaration (*note Declaring the Home Environment::, it can be “instantiated” using the ‘guix home’ command. The synopsis is: guix home OPTIONS... ACTION FILE FILE must be the name of a file containing a ‘home-environment’ declaration. ACTION specifies how the home environment is instantiated, but there are few auxiliary actions which don’t instantiate it. Currently the following values are supported: ‘search’ Display available home service type definitions that match the given regular expressions, sorted by relevance: $ guix home search shell name: home-shell-profile location: gnu/home/services/shells.scm:100:2 extends: home-files description: Create `~/.profile', which is used for environment initialization of POSIX compliant login shells. + This service type can be extended with a list of file-like objects. relevance: 6 name: home-fish location: gnu/home/services/shells.scm:640:2 extends: home-files home-profile description: Install and configure Fish, the friendly interactive shell. relevance: 3 name: home-zsh location: gnu/home/services/shells.scm:290:2 extends: home-files home-profile description: Install and configure Zsh. relevance: 1 name: home-bash location: gnu/home/services/shells.scm:508:2 extends: home-files home-profile description: Install and configure GNU Bash. relevance: 1 ... As for ‘guix search’, the result is written in ‘recutils’ format, which makes it easy to filter the output (*note GNU recutils databases: (recutils)Top.). ‘容器’ Spawn a shell in an isolated environment—a “container”—containing your home as specified by FILE. For example, this is how you would start an interactive shell in a container with your home: guix home container config.scm This is a throw-away container where you can lightheartedly fiddle with files; any changes made within the container, any process started—all this disappears as soon as you exit that shell. As with ‘guix shell’, several options control that container: ‘--network’ ‘-N’ Enable networking within the container (it is disabled by default). ‘--expose=SOURCE[=TARGET]’ ‘--share=SOURCE[=TARGET]’ As with ‘guix shell’, make directory SOURCE of the host system available as TARGET inside the container—read-only if you pass ‘--expose’, and writable if you pass ‘--share’ (*note ‘--expose’ and ‘--share’: Invoking guix shell.). Additionally, you can run a command in that container, instead of spawning an interactive shell. For instance, here is how you would check which Shepherd services are started in a throw-away home container: guix home container config.scm -- herd status The command to run in the container must come after ‘--’ (double hyphen). ‘edit’ Edit or view the definition of the given Home service types. For example, the command below opens your editor, as specified by the ‘EDITOR’ environment variable, on the definition of the ‘home-mcron’ service type: guix home edit home-mcron ‘reconfigure’ Build the home environment described in FILE, and switch to it. Switching means that the activation script will be evaluated and (in basic scenario) symlinks to configuration files generated from ‘home-environment’ declaration will be created in ‘~’. If the file with the same path already exists in home folder it will be moved to ‘~/TIMESTAMP-guix-home-legacy-configs-backup’, where TIMESTAMP is a current UNIX epoch time. 注: It is highly recommended to run ‘guix pull’ once before you run ‘guix home reconfigure’ for the first time (*note 调用guix pull::). This effects all the configuration specified in FILE. The command starts Shepherd services specified in FILE that are not currently running; if a service is currently running, this command will arrange for it to be upgraded the next time it is stopped (e.g. by ‘herd stop SERVICE’ or ‘herd restart SERVICE’). This command creates a new generation whose number is one greater than the current generation (as reported by ‘guix home list-generations’). If that generation already exists, it will be overwritten. This behavior mirrors that of ‘guix package’ (*note 调用guix package::). Upon completion, the new home is deployed under ‘~/.guix-home’. This directory contains “provenance meta-data”: the list of channels in use (*note 通道::) and FILE itself, when available. You can view the provenance information by running: guix home describe This information is useful should you later want to inspect how this particular generation was built. In fact, assuming FILE is self-contained, you can later rebuild generation N of your home environment with: guix time-machine \ -C /var/guix/profiles/per-user/USER/guix-home-N-link/channels.scm -- \ home reconfigure \ /var/guix/profiles/per-user/USER/guix-home-N-link/configuration.scm You can think of it as some sort of built-in version control! Your home is not just a binary artifact: _it carries its own source_. ‘switch-generation’ Switch to an existing home generation. This action atomically switches the home profile to the specified home generation. The target generation can be specified explicitly by its generation number. For example, the following invocation would switch to home generation 7: guix home switch-generation 7 The target generation can also be specified relative to the current generation with the form ‘+N’ or ‘-N’, where ‘+3’ means “3 generations ahead of the current generation,” and ‘-1’ means “1 generation prior to the current generation.” When specifying a negative value such as ‘-1’, you must precede it with ‘--’ to prevent it from being parsed as an option. For example: guix home switch-generation -- -1 This action will fail if the specified generation does not exist. ‘roll-back’ Switch to the preceding home generation. This is the inverse of ‘reconfigure’, and it is exactly the same as invoking ‘switch-generation’ with an argument of ‘-1’. ‘delete-generations’ Delete home generations, making them candidates for garbage collection (*note 调用guix gc::, for information on how to run the “garbage collector”). This works in the same way as ‘guix package --delete-generations’ (*note ‘--delete-generations’: 调用guix package.). With no arguments, all home generations but the current one are deleted: guix home delete-generations You can also select the generations you want to delete. The example below deletes all the home generations that are more than two months old: guix home delete-generations 2m ‘build’ Build the derivation of the home environment, which includes all the configuration files and programs needed. This action does not actually install anything. ‘describe’ Describe the current home generation: its file name, as well as provenance information when available. To show installed packages in the current home generation’s profile, the ‘--list-installed’ flag is provided, with the same syntax that is used in ‘guix package --list-installed’ (*note 调用guix package::). For instance, the following command shows a table of all the packages with “emacs” in their name that are installed in the current home generation’s profile: guix home describe --list-installed=emacs ‘list-generations’ List a summary of each generation of the home environment available on disk, in a human-readable way. This is similar to the ‘--list-generations’ option of ‘guix package’ (*note 调用guix package::). Optionally, one can specify a pattern, with the same syntax that is used in ‘guix package --list-generations’, to restrict the list of generations displayed. For instance, the following command displays generations that are up to 10 days old: guix home list-generations 10d The ‘--list-installed’ flag may also be specified, with the same syntax that is used in ‘guix home describe’. This may be helpful if trying to determine when a package was added to the home profile. ‘import’ Generate a “home environment” from the packages in the default profile and configuration files found in the user’s home directory. The configuration files will be copied to the specified directory, and a ‘home-configuration.scm’ will be populated with the home environment. Note that not every home service that exists is supported (*note Home Services::). $ guix home import ~/guix-config guix home: '/home/alice/guix-config' populated with all the Home configuration files And there’s more! ‘guix home’ also provides the following sub-commands to visualize how the services of your home environment relate to one another: ‘extension-graph’ Emit to standard output the “service extension graph” of the home environment defined in FILE (*note 合成服务::, for more information on service extensions). By default the output is in Dot/Graphviz format, but you can choose a different format with ‘--graph-backend’, as with ‘guix graph’ (*note ‘--backend’: 调用guix graph.): The command: guix home extension-graph FILE | xdot - shows the extension relations among services. ‘shepherd-graph’ Emit to standard output the “dependency graph” of shepherd services of the home environment defined in FILE. *Note Shepherd服务::, for more information and for an example graph. Again, the default output format is Dot/Graphviz, but you can pass ‘--graph-backend’ to select a different one. OPTIONS can contain any of the common build options (*note 普通的构建选项::). In addition, OPTIONS can contain one of the following: ‘--expression=EXPR’ ‘-e EXPR’ Consider the home-environment EXPR evaluates to. This is an alternative to specifying a file which evaluates to a home environment. ‘--allow-downgrades’ Instruct ‘guix home reconfigure’ to allow system downgrades. Just like ‘guix system’, ‘guix home reconfigure’, by default, prevents you from downgrading your home to older or unrelated revisions compared to the channel revisions that were used to deploy it—those shown by ‘guix home describe’. Using ‘--allow-downgrades’ allows you to bypass that check, at the risk of downgrading your home—be careful!  File: guix.zh_CN.info, Node: 文档, Next: Platforms, Prev: Home Configuration, Up: Top 14 文档 ******* In most cases packages installed with Guix come with documentation. There are two main documentation formats: “Info”, a browsable hypertext format used for GNU software, and “manual pages” (or “man pages”), the linear documentation format traditionally found on Unix. Info manuals are accessed with the ‘info’ command or with Emacs, and man pages are accessed using ‘man’. You can look for documentation of software installed on your system by keyword. For example, the following command searches for information about “TLS” in Info manuals: $ info -k TLS "(emacs)Network Security" -- STARTTLS "(emacs)Network Security" -- TLS "(gnutls)Core TLS API" -- gnutls_certificate_set_verify_flags "(gnutls)Core TLS API" -- gnutls_certificate_set_verify_function ... The command below searches for the same keyword in man pages(1): $ man -k TLS SSL (7) - OpenSSL SSL/TLS library certtool (1) - GnuTLS certificate tool ... These searches are purely local to your computer so you have the guarantee that documentation you find corresponds to what you have actually installed, you can access it off-line, and your privacy is respected. Once you have these results, you can view the relevant documentation by running, say: $ info "(gnutls)Core TLS API" or: $ man certtool Info manuals contain sections and indices as well as hyperlinks like those found in Web pages. The ‘info’ reader (*note Info reader: (info-stnd)Top.) and its Emacs counterpart (*note (emacs)Misc Help::) provide intuitive key bindings to navigate manuals. *Note (info)入门::, for an introduction to Info navigation. ---------- Footnotes ---------- (1) The database searched by ‘man -k’ is only created in profiles that contain the ‘man-db’ package.  File: guix.zh_CN.info, Node: Platforms, Next: System Images, Prev: 文档, Up: Top 15 Platforms ************ The packages and systems built by Guix are intended, like most computer programs, to run on a CPU with a specific instruction set, and under a specific operating system. Those programs are often also targeting a specific kernel and system library. Those constraints are captured by Guix in ‘platform’ records. * Menu: * platform Reference:: Detail of platform declarations. * Supported Platforms:: Description of the supported platforms.  File: guix.zh_CN.info, Node: platform Reference, Next: Supported Platforms, Up: Platforms 15.1 ‘platform’ Reference ========================= The ‘platform’ data type describes a “platform”: an ISA (instruction set architecture), combined with an operating system and possibly additional system-wide settings such as the ABI (application binary interface). -- Data Type: platform This is the data type representing a platform. ‘target’ This field specifies the platform’s GNU triplet as a string (*note GNU configuration triplets: (autoconf)Specifying Target Triplets.). ‘系统’ This string is the system type as it is known to Guix and passed, for instance, to the ‘--system’ option of most commands. It usually has the form ‘"CPU-KERNEL"’, where CPU is the target CPU and KERNEL the target operating system kernel. It can be for instance ‘"aarch64-linux"’ or ‘"armhf-linux"’. You will encounter system types when you perform native builds (*note Native Builds::). ‘linux-architecture’ (default: ‘#false’) This optional string field is only relevant if the kernel is Linux. In that case, it corresponds to the ARCH variable used when building Linux, ‘"mips"’ for instance. ‘glibc-dynamic-linker’ This field is the name of the GNU C Library dynamic linker for the corresponding system, as a string. It can be ‘"/lib/ld-linux-armhf.so.3"’.  File: guix.zh_CN.info, Node: Supported Platforms, Prev: platform Reference, Up: Platforms 15.2 Supported Platforms ======================== The ‘(guix platforms ...)’ modules export the following variables, each of which is bound to a ‘platform’ record. -- Scheme Variable: armv7-linux Platform targeting ARM v7 CPU running GNU/Linux. -- Scheme Variable: aarch64-linux Platform targeting ARM v8 CPU running GNU/Linux. -- Scheme Variable: mips64-linux Platform targeting MIPS little-endian 64-bit CPU running GNU/Linux. -- Scheme Variable: powerpc-linux Platform targeting PowerPC big-endian 32-bit CPU running GNU/Linux. -- Scheme Variable: powerpc64le-linux Platform targeting PowerPC little-endian 64-bit CPU running GNU/Linux. -- Scheme Variable: riscv64-linux Platform targeting RISC-V 64-bit CPU running GNU/Linux. -- Scheme Variable: i686-linux Platform targeting x86 CPU running GNU/Linux. -- Scheme Variable: x86_64-linux Platform targeting x86 64-bit CPU running GNU/Linux. -- Scheme Variable: i686-mingw Platform targeting x86 CPU running Windows, with run-time support from MinGW. -- Scheme Variable: x86_64-mingw Platform targeting x86 64-bit CPU running Windows, with run-time support from MinGW. -- Scheme Variable: i586-gnu Platform targeting x86 CPU running GNU/Hurd (also referred to as “GNU”).  File: guix.zh_CN.info, Node: System Images, Next: 安装调试文件, Prev: Platforms, Up: Top 16 Creating System Images ************************* When it comes to installing Guix System for the first time on a new machine, you can basically proceed in three different ways. The first one is to use an existing operating system on the machine to run the ‘guix system init’ command (*note 调用guix system::). The second one, is to produce an installation image (*note 构建安装镜像::). This is a bootable system which role is to eventually run ‘guix system init’. Finally, the third option would be to produce an image that is a direct instantiation of the system you wish to run. That image can then be copied on a bootable device such as an USB drive or a memory card. The target machine would then directly boot from it, without any kind of installation procedure. The ‘guix system image’ command is able to turn an operating system definition into a bootable image. This command supports different image types, such as ‘efi-raw’, ‘iso9660’ and ‘docker’. Any modern ‘x86_64’ machine will probably be able to boot from an ‘iso9660’ image. However, there are a few machines out there that require specific image types. Those machines, in general using ‘ARM’ processors, may expect specific partitions at specific offsets. This chapter explains how to define customized system images and how to turn them into actual bootable images. * Menu: * image Reference:: Detail of image declarations. * Instantiate an Image:: How to instantiate an image record. * image-type Reference:: Detail of image types declaration. * Image Modules:: Definition of image modules.  File: guix.zh_CN.info, Node: image Reference, Next: Instantiate an Image, Up: System Images 16.1 ‘image’ Reference ====================== The ‘image’ record, described right after, allows you to define a customized bootable system image. -- Data Type: image This is the data type representing a system image. ‘name’ (default: ‘#false’) The image name as a symbol, ‘'my-iso9660’ for instance. The name is optional and it defaults to ‘#false’. ‘format’ The image format as a symbol. The following formats are supported: • ‘disk-image’, a raw disk image composed of one or multiple partitions. • ‘compressed-qcow2’, a compressed qcow2 image composed of one or multiple partitions. • ‘docker’, a Docker image. • ‘iso9660’, an ISO-9660 image. • ‘tarball’, a tar.gz image archive. • ‘wsl2’, a WSL2 image. ‘platform’ (default: ‘#false’) The ‘platform’ record the image is targeting (*note Platforms::), ‘aarch64-linux’ for instance. By default, this field is set to ‘#false’ and the image will target the host platform. ‘size’ (default: ‘'guess’) The image size in bytes or ‘'guess’. The ‘'guess’ symbol, which is the default, means that the image size will be inferred based on the image content. ‘operating-system’ The image’s ‘operating-system’ record that is instanciated. ‘partition-table-type’ (default: ‘'mbr’) The image partition table type as a symbol. Possible values are ‘'mbr’ and ‘'gpt’. It default to ‘'mbr’. ‘partitions’ (default: ‘'()’) The image partitions as a list of ‘partition’ records (*note partition Reference::). ‘compression?’ (default: ‘#true’) Whether the image content should be compressed, as a boolean. It defaults to ‘#true’ and only applies to ‘'iso9660’ image formats. ‘volatile-root?’ (default: ‘#true’) Whether the image root partition should be made volatile, as a boolean. This is achieved by using a RAM backed file system (overlayfs) that is mounted on top of the root partition by the initrd. It defaults to ‘#true’. When set to ‘#false’, the image root partition is mounted as read-write partition by the initrd. ‘shared-store?’ (default: ‘#false’) Whether the image’s store should be shared with the host system, as a boolean. This can be useful when creating images dedicated to virtual machines. When set to ‘#false’, which is the default, the image’s ‘operating-system’ closure is copied to the image. Otherwise, when set to ‘#true’, it is assumed that the host store will be made available at boot, using a ‘9p’ mount for instance. ‘shared-network?’ (default: ‘#false’) Whether to use the host network interfaces within the image, as a boolean. This is only used for the ‘'docker’ image format. It defaults to ‘#false’. ‘substitutable?’ (default: ‘#true’) Whether the image derivation should be substitutable, as a boolean. It defaults to ‘true’. * Menu: * partition Reference::  File: guix.zh_CN.info, Node: partition Reference, Up: image Reference 16.1.1 ‘partition’ Reference ---------------------------- In ‘image’ record may contain some partitions. -- Data Type: partition This is the data type representing an image partition. ‘size’ (default: ‘'guess’) The partition size in bytes or ‘'guess’. The ‘'guess’ symbol, which is the default, means that the partition size will be inferred based on the partition content. ‘offset’ (default: ‘0’) The partition’s start offset in bytes, relative to the image start or the previous partition end. It defaults to ‘0’ which means that there is no offset applied. ‘file-system’ (default: ‘"ext4"’) The partition file system as a string, defaulting to ‘"ext4"’. The supported values are ‘"vfat"’, ‘"fat16"’, ‘"fat32"’ and ‘"ext4"’. ‘file-system-options’ (default: ‘'()’) The partition file system creation options that should be passed to the partition creation tool, as a list of strings. This is only supported when creating ‘"ext4"’ partitions. See the ‘"extended-options"’ man page section of the ‘"mke2fs"’ tool for a more complete reference. ‘label’ The partition label as a mandatory string, ‘"my-root"’ for instance. ‘uuid’ (default: ‘#false’) The partition UUID as an ‘uuid’ record (*note 文件系统::). By default it is ‘#false’, which means that the partition creation tool will attribute a random UUID to the partition. ‘flags’ (default: ‘'()’) The partition flags as a list of symbols. Possible values are ‘'boot’ and ‘'esp’. The ‘'boot’ flags should be set if you want to boot from this partition. Exactly one partition should have this flag set, usually the root one. The ‘'esp’ flag identifies a UEFI System Partition. ‘initializer’ (default: ‘#false’) The partition initializer procedure as a gexp. This procedure is called to populate a partition. If no initializer is passed, the ‘initialize-root-partition’ procedure from the ‘(gnu build image)’ module is used.  File: guix.zh_CN.info, Node: Instantiate an Image, Next: image-type Reference, Prev: image Reference, Up: System Images 16.2 Instantiate an Image ========================= Let’s say you would like to create an MBR image with three distinct partitions: • The ESP (EFI System Partition), a partition of 40 MiB at offset 1024 KiB with a vfat file system. • an ext4 partition of 50 MiB data file, and labeled “data”. • an ext4 bootable partition containing the ‘%simple-os’ operating-system. You would then write the following image definition in a ‘my-image.scm’ file for instance. (use-modules (gnu) (gnu image) (gnu tests) (gnu system image) (guix gexp)) (define MiB (expt 2 20)) (image (format 'disk-image) (operating-system %simple-os) (partitions (list (partition (size (* 40 MiB)) (offset (* 1024 1024)) (label "GNU-ESP") (file-system "vfat") (flags '(esp)) (initializer (gexp initialize-efi-partition))) (partition (size (* 50 MiB)) (label "DATA") (file-system "ext4") (initializer #~(lambda* (root . rest) (mkdir root) (call-with-output-file (string-append root "/data") (lambda (port) (format port "my-data")))))) (partition (size 'guess) (label root-label) (file-system "ext4") (flags '(boot)) (initializer (gexp initialize-root-partition)))))) Note that the first and third partitions use generic initializers procedures, initialize-efi-partition and initialize-root-partition respectively. The initialize-efi-partition installs a GRUB EFI loader that is loading the GRUB bootloader located in the root partition. The initialize-root-partition instantiates a complete system as defined by the ‘%simple-os’ operating-system. You can now run: guix system image my-image.scm to instantiate the ‘image’ definition. That produces a disk image which has the expected structure: $ parted $(guix system image my-image.scm) print ... Model: (file) Disk /gnu/store/yhylv1bp5b2ypb97pd3bbhz6jk5nbhxw-disk-image: 1714MB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 43.0MB 41.9MB primary fat16 esp 2 43.0MB 95.4MB 52.4MB primary ext4 3 95.4MB 1714MB 1619MB primary ext4 boot The size of the ‘boot’ partition has been inferred to ‘1619MB’ so that it is large enough to host the ‘%simple-os’ operating-system. You can also use existing ‘image’ record definitions and inherit from them to simplify the ‘image’ definition. The ‘(gnu system image)’ module provides the following ‘image’ definition variables. -- Scheme Variable: efi-disk-image A MBR disk-image composed of two partitions: a 64 bits ESP partition and a ROOT boot partition. This image can be used on most ‘x86_64’ and ‘i686’ machines, supporting BIOS or UEFI booting. -- Scheme Variable: efi32-disk-image Same as ‘efi-disk-image’ but with a 32 bits EFI partition. -- Scheme Variable: iso9660-image An ISO-9660 image composed of a single bootable partition. This image can also be used on most ‘x86_64’ and ‘i686’ machines. -- Scheme Variable: docker-image A Docker image that can be used to spawn a Docker container. Using the ‘efi-disk-image’ we can simplify our previous ‘image’ declaration this way: (use-modules (gnu) (gnu image) (gnu tests) (gnu system image) (guix gexp) (ice-9 match)) (define MiB (expt 2 20)) (define data (partition (size (* 50 MiB)) (label "DATA") (file-system "ext4") (initializer #~(lambda* (root . rest) (mkdir root) (call-with-output-file (string-append root "/data") (lambda (port) (format port "my-data"))))))) (image (inherit efi-disk-image) (operating-system %simple-os) (partitions (match (image-partitions efi-disk-image) ((esp root) (list esp data root))))) This will give the exact same ‘image’ instantiation but the ‘image’ declaration is simpler.  File: guix.zh_CN.info, Node: image-type Reference, Next: Image Modules, Prev: Instantiate an Image, Up: System Images 16.3 image-type Reference ========================= The ‘guix system image’ command can, as we saw above, take a file containing an ‘image’ declaration as argument and produce an actual disk image from it. The same command can also handle a file containing an ‘operating-system’ declaration as argument. In that case, how is the ‘operating-system’ turned into an image? That’s where the ‘image-type’ record intervenes. This record defines how to transform an ‘operating-system’ record into an ‘image’ record. -- Data Type: image-type This is the data type representing an image-type. ‘名字’ The image-type name as a mandatory symbol, ‘'efi32-raw’ for instance. ‘constructor’ The image-type constructor, as a mandatory procedure that takes an ‘operating-system’ record as argument and returns an ‘image’ record. There are several ‘image-type’ records provided by the ‘(gnu system image)’ and the ‘(gnu system images ...)’ modules. -- Scheme Variable: efi-raw-image-type Build an image based on the ‘efi-disk-image’ image. -- Scheme Variable: efi32-raw-image-type Build an image based on the ‘efi32-disk-image’ image. -- Scheme Variable: qcow2-image-type Build an image based on the ‘efi-disk-image’ image but with the ‘compressed-qcow2’ image format. -- Scheme Variable: iso-image-type Build a compressed image based on the ‘iso9660-image’ image. -- Scheme Variable: uncompressed-iso-image-type Build an image based on the ‘iso9660-image’ image but with the ‘compression?’ field set to ‘#false’. -- Scheme Variable: docker-image-type Build an image based on the ‘docker-image’ image. -- Scheme Variable: raw-with-offset-image-type Build an MBR image with a single partition starting at a ‘1024KiB’ offset. This is useful to leave some room to install a bootloader in the post-MBR gap. -- Scheme Variable: pinebook-pro-image-type Build an image that is targeting the Pinebook Pro machine. The MBR image contains a single partition starting at a ‘9MiB’ offset. The ‘u-boot-pinebook-pro-rk3399-bootloader’ bootloader will be installed in this gap. -- Scheme Variable: rock64-image-type Build an image that is targeting the Rock64 machine. The MBR image contains a single partition starting at a ‘16MiB’ offset. The ‘u-boot-rock64-rk3328-bootloader’ bootloader will be installed in this gap. -- Scheme Variable: novena-image-type Build an image that is targeting the Novena machine. It has the same characteristics as ‘raw-with-offset-image-type’. -- Scheme Variable: pine64-image-type Build an image that is targeting the Pine64 machine. It has the same characteristics as ‘raw-with-offset-image-type’. -- Scheme Variable: hurd-image-type Build an image that is targeting a ‘i386’ machine running the Hurd kernel. The MBR image contains a single ext2 partitions with specific ‘file-system-options’ flags. -- Scheme Variable: hurd-qcow2-image-type Build an image similar to the one built by the ‘hurd-image-type’ but with the ‘format’ set to ‘'compressed-qcow2’. -- Scheme Variable: wsl2-image-type Build an image for the WSL2 (Windows Subsystem for Linux 2). It can be imported by running: wsl --import Guix ./guix ./wsl2-image.tar.gz wsl -d Guix So, if we get back to the ‘guix system image’ command taking an ‘operating-system’ declaration as argument. By default, the ‘efi-raw-image-type’ is used to turn the provided ‘operating-system’ into an actual bootable image. To use a different ‘image-type’, the ‘--image-type’ option can be used. The ‘--list-image-types’ option will list all the supported image types. It turns out to be a textual listing of all the ‘image-types’ variables described just above (*note 调用guix system::).  File: guix.zh_CN.info, Node: Image Modules, Prev: image-type Reference, Up: System Images 16.4 Image Modules ================== Let’s take the example of the Pine64, an ARM based machine. To be able to produce an image targeting this board, we need the following elements: • An ‘operating-system’ record containing at least an appropriate kernel (‘linux-libre-arm64-generic’) and bootloader ‘u-boot-pine64-lts-bootloader’) for the Pine64. • Possibly, an ‘image-type’ record providing a way to turn an ‘operating-system’ record to an ‘image’ record suitable for the Pine64. • An actual ‘image’ that can be instantiated with the ‘guix system image’ command. The ‘(gnu system images pine64)’ module provides all those elements: ‘pine64-barebones-os’, ‘pine64-image-type’ and ‘pine64-barebones-raw-image’ respectively. The module returns the ‘pine64-barebones-raw-image’ in order for users to be able to run: guix system image gnu/system/images/pine64.scm Now, thanks to the ‘pine64-image-type’ record declaring the ‘'pine64-raw’ ‘image-type’, one could also prepare a ‘my-pine.scm’ file with the following content: (use-modules (gnu system images pine64)) (operating-system (inherit pine64-barebones-os) (timezone "Europe/Athens")) to customize the ‘pine64-barebones-os’, and run: $ guix system image --image-type=pine64-raw my-pine.scm Note that there are other modules in the ‘gnu/system/images’ directory targeting ‘Novena’, ‘Pine64’, ‘PinebookPro’ and ‘Rock64’ machines.  File: guix.zh_CN.info, Node: 安装调试文件, Next: Using TeX and LaTeX, Prev: System Images, Up: Top 17 安装调试文件 *************** Program binaries, as produced by the GCC compilers for instance, are typically written in the ELF format, with a section containing “debugging information”. Debugging information is what allows the debugger, GDB, to map binary code to source code; it is required to debug a compiled program in good conditions. This chapter explains how to use separate debug info when packages provide it, and how to rebuild packages with debug info when it’s missing. * Menu: * Separate Debug Info:: 安装“调试”输出 * Rebuilding Debug Info:: Building missing debug info.  File: guix.zh_CN.info, Node: Separate Debug Info, Next: Rebuilding Debug Info, Up: 安装调试文件 17.1 Separate Debug Info ======================== The problem with debugging information is that is takes up a fair amount of disk space. For example, debugging information for the GNU C Library weighs in at more than 60 MiB. Thus, as a user, keeping all the debugging info of all the installed programs is usually not an option. Yet, space savings should not come at the cost of an impediment to debugging—especially in the GNU system, which should make it easier for users to exert their computing freedom (*note GNU发行版::). Thankfully, the GNU Binary Utilities (Binutils) and GDB provide a mechanism that allows users to get the best of both worlds: debugging information can be stripped from the binaries and stored in separate files. GDB is then able to load debugging information from those files, when they are available (*note (gdb)Separate Debug Files::). The GNU distribution takes advantage of this by storing debugging information in the ‘lib/debug’ sub-directory of a separate package output unimaginatively called ‘debug’ (*note 有多个输出的软件包::). Users can choose to install the ‘debug’ output of a package when they need it. For instance, the following command installs the debugging information for the GNU C Library and for GNU Guile: guix install glibc:debug guile:debug GDB must then be told to look for debug files in the user’s profile, by setting the ‘debug-file-directory’ variable (consider setting it from the ‘~/.gdbinit’ file, *note (gdb)Startup::): (gdb) set debug-file-directory ~/.guix-profile/lib/debug From there on, GDB will pick up debugging information from the ‘.debug’ files under ‘~/.guix-profile/lib/debug’. Below is an alternative GDB script which is useful when working with other profiles. It takes advantage of the optional Guile integration in GDB. This snippet is included by default on Guix System in the ‘~/.gdbinit’ file. guile (use-modules (gdb)) (execute (string-append "set debug-file-directory " (or (getenv "GDB_DEBUG_FILE_DIRECTORY") "~/.guix-profile/lib/debug"))) end In addition, you will most likely want GDB to be able to show the source code being debugged. To do that, you will have to unpack the source code of the package of interest (obtained with ‘guix build --source’, *note 调用guix build::), and to point GDB to that source directory using the ‘directory’ command (*note ‘directory’: (gdb)Source Path.). The ‘debug’ output mechanism in Guix is implemented by the ‘gnu-build-system’ (*note 构建系统::). Currently, it is opt-in—debugging information is available only for the packages with definitions explicitly declaring a ‘debug’ output. To check whether a package has a ‘debug’ output, use ‘guix package --list-available’ (*note 调用guix package::). Read on for how to deal with packages lacking a ‘debug’ output.  File: guix.zh_CN.info, Node: Rebuilding Debug Info, Prev: Separate Debug Info, Up: 安装调试文件 17.2 Rebuilding Debug Info ========================== As we saw above, some packages, but not all, provide debugging info in a ‘debug’ output. What can you do when debugging info is missing? The ‘--with-debug-info’ option provides a solution to that: it allows you to rebuild the package(s) for which debugging info is missing—and only those—and to graft those onto the application you’re debugging. Thus, while it’s not as fast as installing a ‘debug’ output, it is relatively inexpensive. Let’s illustrate that. Suppose you’re experiencing a bug in Inkscape and would like to see what’s going on in GLib, a library that’s deep down in its dependency graph. As it turns out, GLib does not have a ‘debug’ output and the backtrace GDB shows is all sadness: (gdb) bt #0 0x00007ffff5f92190 in g_getenv () from /gnu/store/...-glib-2.62.6/lib/libglib-2.0.so.0 #1 0x00007ffff608a7d6 in gobject_init_ctor () from /gnu/store/...-glib-2.62.6/lib/libgobject-2.0.so.0 #2 0x00007ffff7fe275a in call_init (l=, argc=argc@entry=1, argv=argv@entry=0x7fffffffcfd8, env=env@entry=0x7fffffffcfe8) at dl-init.c:72 #3 0x00007ffff7fe2866 in call_init (env=0x7fffffffcfe8, argv=0x7fffffffcfd8, argc=1, l=) at dl-init.c:118 To address that, you install Inkscape linked against a variant GLib that contains debug info: guix install inkscape --with-debug-info=glib This time, debugging will be a whole lot nicer: $ gdb --args sh -c 'exec inkscape' ... (gdb) b g_getenv Function "g_getenv" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (g_getenv) pending. (gdb) r Starting program: /gnu/store/...-profile/bin/sh -c exec\ inkscape ... (gdb) bt #0 g_getenv (variable=variable@entry=0x7ffff60c7a2e "GOBJECT_DEBUG") at ../glib-2.62.6/glib/genviron.c:252 #1 0x00007ffff608a7d6 in gobject_init () at ../glib-2.62.6/gobject/gtype.c:4380 #2 gobject_init_ctor () at ../glib-2.62.6/gobject/gtype.c:4493 #3 0x00007ffff7fe275a in call_init (l=, argc=argc@entry=3, argv=argv@entry=0x7fffffffd088, env=env@entry=0x7fffffffd0a8) at dl-init.c:72 ... Much better! Note that there can be packages for which ‘--with-debug-info’ will not have the desired effect. *Note ‘--with-debug-info’: 软件包转换选项, for more information.  File: guix.zh_CN.info, Node: Using TeX and LaTeX, Next: 安全更新, Prev: 安装调试文件, Up: Top 18 Using TeX and LaTeX ********************** Guix provides packages for the TeX, LaTeX, ConTeXt, LuaTeX, and related typesetting systems, taken from the TeX Live distribution (https://www.tug.org/texlive/). However, because TeX Live is so huge and because finding your way in this maze is tricky, we thought that you, dear user, would welcome guidance on how to deploy the relevant packages so you can compile your TeX and LaTeX documents. TeX Live currently comes in two flavors in Guix: • The “monolithic” ‘texlive’ package: it comes with _every single TeX Live package_ (more than 7,000 of them), but it is huge (more than 4 GiB for a single package!). • The “modular” ‘texlive-’ packages: you install ‘texlive-base’, which provides core functionality and the main commands—‘pdflatex’, ‘dvips’, ‘luatex’, ‘mf’, etc.—together with individual packages that provide just the features you need—‘texlive-listings’ for the ‘listings’ package, ‘texlive-hyperref’ for ‘hyperref’, ‘texlive-beamer’ for Beamer, ‘texlive-pgf’ for PGF/TikZ, and so on. We recommend using the modular package set because it is much less resource-hungry. To build your documents, you would use commands such as: guix shell texlive-base texlive-wrapfig \ texlive-hyperref texlive-cm-super -- pdflatex doc.tex You can quickly end up with unreasonably long command lines though. The solution is to instead write a manifest, for example like this one: (specifications->manifest '("rubber" "texlive-base" "texlive-wrapfig" "texlive-microtype" "texlive-listings" "texlive-hyperref" ;; PGF/TikZ "texlive-pgf" ;; Additional fonts. "texlive-cm-super" "texlive-amsfonts" "texlive-times" "texlive-helvetic" "texlive-courier")) You can then pass it to any command with the ‘-m’ option: guix shell -m manifest.scm -- pdflatex doc.tex *Note 书写清单::, for more on manifests. In the future, we plan to provide packages for TeX Live “collections”—“meta-packages” such as ‘fontsrecommended’, ‘humanities’, or ‘langarabic’ that provide the set of packages needed in this particular domain. That will allow you to list fewer packages. The main difficulty here is that using the modular package set forces you to select precisely the packages that you need. You can use ‘guix search’, but finding the right package can prove to be tedious. When a package is missing, ‘pdflatex’ and similar commands fail with an obscure message along the lines of: doc.tex: File `tikz.sty' not found. doc.tex:7: Emergency stop. or, for a missing font: kpathsea: Running mktexmf phvr7t ! I can't find file `phvr7t'. How do you determine what the missing package is? In the first case, you’ll find the answer by running: $ guix search texlive tikz name: texlive-pgf version: 59745 ... In the second case, ‘guix search’ turns up nothing. Instead, you can search the TeX Live package database using the ‘tlmgr’ command: $ guix shell texlive-base -- tlmgr info phvr7t tlmgr: cannot find package phvr7t, searching for other matches: Packages containing `phvr7t' in their title/description: Packages containing files matching `phvr7t': helvetic: texmf-dist/fonts/tfm/adobe/helvetic/phvr7t.tfm texmf-dist/fonts/tfm/adobe/helvetic/phvr7tn.tfm texmf-dist/fonts/vf/adobe/helvetic/phvr7t.vf texmf-dist/fonts/vf/adobe/helvetic/phvr7tn.vf tex4ht: texmf-dist/tex4ht/ht-fonts/alias/adobe/helvetic/phvr7t.htf The file is available in the TeX Live ‘helvetic’ package, which is known in Guix as ‘texlive-helvetic’. Quite a ride, but we found it! There is one important limitation though: Guix currently provides a subset of the TeX Live packages. If you stumble upon a missing package, you can try and import it (*note 调用guix import::): guix import texlive PACKAGE Additional options include: ‘--recursive’ ‘-r’ Traverse the dependency graph of the given upstream package recursively and generate package expressions for all those packages that are not yet in Guix. 注: TeX Live packaging is still very much work in progress, but you can help! *Note 贡献::, for more information.  File: guix.zh_CN.info, Node: 安全更新, Next: 引导, Prev: Using TeX and LaTeX, Up: Top 19 安全更新 *********** Occasionally, important security vulnerabilities are discovered in software packages and must be patched. Guix developers try hard to keep track of known vulnerabilities and to apply fixes as soon as possible in the ‘master’ branch of Guix (we do not yet provide a “stable” branch containing only security updates). The ‘guix lint’ tool helps developers find out about vulnerable versions of software packages in the distribution: $ guix lint -c cve gnu/packages/base.scm:652:2: glibc@2.21: probably vulnerable to CVE-2015-1781, CVE-2015-7547 gnu/packages/gcc.scm:334:2: gcc@4.9.3: probably vulnerable to CVE-2015-5276 gnu/packages/image.scm:312:2: openjpeg@2.1.0: probably vulnerable to CVE-2016-1923, CVE-2016-1924 ... *Note 调用guix lint::, for more information. Guix follows a functional package management discipline (*note 介绍::), which implies that, when a package is changed, _every package that depends on it_ must be rebuilt. This can significantly slow down the deployment of fixes in core packages such as libc or Bash, since basically the whole distribution would need to be rebuilt. Using pre-built binaries helps (*note substitutes::), but deployment may still take more time than desired. To address this, Guix implements “grafts”, a mechanism that allows for fast deployment of critical updates without the costs associated with a whole-distribution rebuild. The idea is to rebuild only the package that needs to be patched, and then to “graft” it onto packages explicitly installed by the user and that were previously referring to the original package. The cost of grafting is typically very low, and order of magnitudes lower than a full rebuild of the dependency chain. For instance, suppose a security update needs to be applied to Bash. Guix developers will provide a package definition for the “fixed” Bash, say ‘bash-fixed’, in the usual way (*note 定义软件包::). Then, the original package definition is augmented with a ‘replacement’ field pointing to the package containing the bug fix: (define bash (package (name "bash") ;; ... (replacement bash-fixed))) From there on, any package depending directly or indirectly on Bash—as reported by ‘guix gc --requisites’ (*note 调用guix gc::)—that is installed is automatically “rewritten” to refer to ‘bash-fixed’ instead of ‘bash’. This grafting process takes time proportional to the size of the package, usually less than a minute for an “average” package on a recent machine. Grafting is recursive: when an indirect dependency requires grafting, then grafting “propagates” up to the package that the user is installing. Currently, the length of the name and version of the graft and that of the package it replaces (‘bash-fixed’ and ‘bash’ in the example above) must be equal. This restriction mostly comes from the fact that grafting works by patching files, including binary files, directly. Other restrictions may apply: for instance, when adding a graft to a package providing a shared library, the original shared library and its replacement must have the same ‘SONAME’ and be binary-compatible. The ‘--no-grafts’ command-line option allows you to forcefully avoid grafting (*note ‘--no-grafts’: 普通的构建选项.). Thus, the command: guix build bash --no-grafts returns the store file name of the original Bash, whereas: guix build bash returns the store file name of the “fixed”, replacement Bash. This allows you to distinguish between the two variants of Bash. To verify which Bash your whole profile refers to, you can run (*note 调用guix gc::): guix gc -R $(readlink -f ~/.guix-profile) | grep bash ... and compare the store file names that you get with those above. Likewise for a complete Guix system generation: guix gc -R $(guix system build my-config.scm) | grep bash Lastly, to check which Bash running processes are using, you can use the ‘lsof’ command: lsof | grep /gnu/store/.*bash  File: guix.zh_CN.info, Node: 引导, Next: 移植, Prev: 安全更新, Up: Top 20 引导 ******* Bootstrapping in our context refers to how the distribution gets built “from nothing”. Remember that the build environment of a derivation contains nothing but its declared inputs (*note 介绍::). So there’s an obvious chicken-and-egg problem: how does the first package get built? How does the first compiler get compiled? It is tempting to think of this question as one that only die-hard hackers may care about. However, while the answer to that question is technical in nature, its implications are wide-ranging. How the distribution is bootstrapped defines the extent to which we, as individuals and as a collective of users and hackers, can trust the software we run. It is a central concern from the standpoint of _security_ and from a _user freedom_ viewpoint. The GNU system is primarily made of C code, with libc at its core. The GNU build system itself assumes the availability of a Bourne shell and command-line tools provided by GNU Coreutils, Awk, Findutils, ‘sed’, and ‘grep’. Furthermore, build programs—programs that run ‘./configure’, ‘make’, etc.—are written in Guile Scheme (*note Derivations::). Consequently, to be able to build anything at all, from scratch, Guix relies on pre-built binaries of Guile, GCC, Binutils, libc, and the other packages mentioned above—the “bootstrap binaries”. These bootstrap binaries are “taken for granted”, though we can also re-create them if needed (*note Preparing to Use the Bootstrap Binaries::). * Menu: * Reduced Binary Seed Bootstrap:: A Bootstrap worthy of GNU. * Preparing to Use the Bootstrap Binaries:: Building that what matters most.  File: guix.zh_CN.info, Node: Reduced Binary Seed Bootstrap, Next: Preparing to Use the Bootstrap Binaries, Up: 引导 20.1 The Reduced Binary Seed Bootstrap ====================================== Guix—like other GNU/Linux distributions—is traditionally bootstrapped from a set of bootstrap binaries: Bourne shell, command-line tools provided by GNU Coreutils, Awk, Findutils, ‘sed’, and ‘grep’ and Guile, GCC, Binutils, and the GNU C Library (*note 引导::). Usually, these bootstrap binaries are “taken for granted.” Taking the bootstrap binaries for granted means that we consider them to be a correct and trustworthy “seed” for building the complete system. Therein lies a problem: the combined size of these bootstrap binaries is about 250MB (*note (mes)Bootstrappable Builds::). Auditing or even inspecting these is next to impossible. For ‘i686-linux’ and ‘x86_64-linux’, Guix now features a “Reduced Binary Seed” bootstrap (1). The Reduced Binary Seed bootstrap removes the most critical tools—from a trust perspective—from the bootstrap binaries: GCC, Binutils and the GNU C Library are replaced by: ‘bootstrap-mescc-tools’ (a tiny assembler and linker) and ‘bootstrap-mes’ (a small Scheme Interpreter and a C compiler written in Scheme and the Mes C Library, built for TinyCC and for GCC). Using these new binary seeds the “missing” Binutils, GCC, and the GNU C Library are built from source. From here on the more traditional bootstrap process resumes. This approach has reduced the bootstrap binaries in size to about 145MB in Guix v1.1. The next step that Guix has taken is to replace the shell and all its utilities with implementations in Guile Scheme, the _Scheme-only bootstrap_. Gash (*note (gash)Gash::) is a POSIX-compatible shell that replaces Bash, and it comes with Gash Utils which has minimalist replacements for Awk, the GNU Core Utilities, Grep, Gzip, Sed, and Tar. The rest of the bootstrap binary seeds that were removed are now built from source. Building the GNU System from source is currently only possible by adding some historical GNU packages as intermediate steps(2). As Gash and Gash Utils mature, and GNU packages become more bootstrappable again (e.g., new releases of GNU Sed will also ship as gzipped tarballs again, as alternative to the hard to bootstrap ‘xz’-compression), this set of added packages can hopefully be reduced again. The graph below shows the resulting dependency graph for ‘gcc-core-mesboot0’, the bootstrap compiler used for the traditional bootstrap of the rest of the Guix System. [image src="images/gcc-core-mesboot0-graph.png" alt="Dependency graph of gcc-core-mesboot0"] The only significant binary bootstrap seeds that remain(3) are a Scheme interpreter and a Scheme compiler: GNU Mes and GNU Guile(4). This further reduction has brought down the size of the binary seed to about 60MB for ‘i686-linux’ and ‘x86_64-linux’. Work is ongoing to remove all binary blobs from our free software bootstrap stack, working towards a Full Source Bootstrap. Also ongoing is work to bring these bootstraps to the ‘arm-linux’ and ‘aarch64-linux’ architectures and to the Hurd. If you are interested, join us on ‘#bootstrappable’ on the Freenode IRC network or discuss on or . ---------- Footnotes ---------- (1) We would like to say: “Full Source Bootstrap” and while we are working towards that goal it would be hyperbole to use that term for what we do now. (2) Packages such as ‘gcc-2.95.3’, ‘binutils-2.14’, ‘glibc-2.2.5’, ‘gzip-1.2.4’, ‘tar-1.22’, and some others. For details, see ‘gnu/packages/commencement.scm’. (3) Ignoring the 68KB ‘mescc-tools’; that will be removed later, together with ‘mes’. (4) Not shown in this graph are the static binaries for ‘bash’, ‘tar’, and ‘xz’ that are used to get Guile running.  File: guix.zh_CN.info, Node: Preparing to Use the Bootstrap Binaries, Prev: Reduced Binary Seed Bootstrap, Up: 引导 20.2 Preparing to Use the Bootstrap Binaries ============================================ [image src="images/bootstrap-graph.png" alt="Dependency graph of the early bootstrap derivations"] The figure above shows the very beginning of the dependency graph of the distribution, corresponding to the package definitions of the ‘(gnu packages bootstrap)’ module. A similar figure can be generated with ‘guix graph’ (*note 调用guix graph::), along the lines of: guix graph -t derivation \ -e '(@@ (gnu packages bootstrap) %bootstrap-gcc)' \ | dot -Tps > gcc.ps or, for the further Reduced Binary Seed bootstrap guix graph -t derivation \ -e '(@@ (gnu packages bootstrap) %bootstrap-mes)' \ | dot -Tps > mes.ps At this level of detail, things are slightly complex. First, Guile itself consists of an ELF executable, along with many source and compiled Scheme files that are dynamically loaded when it runs. This gets stored in the ‘guile-2.0.7.tar.xz’ tarball shown in this graph. This tarball is part of Guix’s “source” distribution, and gets inserted into the store with ‘add-to-store’ (*note 仓库::). But how do we write a derivation that unpacks this tarball and adds it to the store? To solve this problem, the ‘guile-bootstrap-2.0.drv’ derivation—the first one that gets built—uses ‘bash’ as its builder, which runs ‘build-bootstrap-guile.sh’, which in turn calls ‘tar’ to unpack the tarball. Thus, ‘bash’, ‘tar’, ‘xz’, and ‘mkdir’ are statically-linked binaries, also part of the Guix source distribution, whose sole purpose is to allow the Guile tarball to be unpacked. Once ‘guile-bootstrap-2.0.drv’ is built, we have a functioning Guile that can be used to run subsequent build programs. Its first task is to download tarballs containing the other pre-built binaries—this is what the ‘.tar.xz.drv’ derivations do. Guix modules such as ‘ftp-client.scm’ are used for this purpose. The ‘module-import.drv’ derivations import those modules in a directory in the store, using the original layout. The ‘module-import-compiled.drv’ derivations compile those modules, and write them in an output directory with the right layout. This corresponds to the ‘#:modules’ argument of ‘build-expression->derivation’ (*note Derivations::). Finally, the various tarballs are unpacked by the derivations ‘gcc-bootstrap-0.drv’, ‘glibc-bootstrap-0.drv’, or ‘bootstrap-mes-0.drv’ and ‘bootstrap-mescc-tools-0.drv’, at which point we have a working C tool chain. Building the Build Tools ======================== Bootstrapping is complete when we have a full tool chain that does not depend on the pre-built bootstrap tools discussed above. This no-dependency requirement is verified by checking whether the files of the final tool chain contain references to the ‘/gnu/store’ directories of the bootstrap inputs. The process that leads to this “final” tool chain is described by the package definitions found in the ‘(gnu packages commencement)’ module. The ‘guix graph’ command allows us to “zoom out” compared to the graph above, by looking at the level of package objects instead of individual derivations—remember that a package may translate to several derivations, typically one derivation to download its source, one to build the Guile modules it needs, and one to actually build the package from source. The command: guix graph -t bag \ -e '(@@ (gnu packages commencement) glibc-final-with-bootstrap-bash)' | xdot - displays the dependency graph leading to the “final” C library(1), depicted below. [image src="images/bootstrap-packages.png" alt="Dependency graph of the early packages"] The first tool that gets built with the bootstrap binaries is GNU Make—noted ‘make-boot0’ above—which is a prerequisite for all the following packages. From there Findutils and Diffutils get built. Then come the first-stage Binutils and GCC, built as pseudo cross tools—i.e., with ‘--target’ equal to ‘--host’. They are used to build libc. Thanks to this cross-build trick, this libc is guaranteed not to hold any reference to the initial tool chain. From there the final Binutils and GCC (not shown above) are built. GCC uses ‘ld’ from the final Binutils, and links programs against the just-built libc. This tool chain is used to build the other packages used by Guix and by the GNU Build System: Guile, Bash, Coreutils, etc. And voilà! At this point we have the complete set of build tools that the GNU Build System expects. These are in the ‘%final-inputs’ variable of the ‘(gnu packages commencement)’ module, and are implicitly used by any package that uses ‘gnu-build-system’ (*note ‘gnu-build-system’: 构建系统.). Building the Bootstrap Binaries =============================== Because the final tool chain does not depend on the bootstrap binaries, those rarely need to be updated. Nevertheless, it is useful to have an automated way to produce them, should an update occur, and this is what the ‘(gnu packages make-bootstrap)’ module provides. The following command builds the tarballs containing the bootstrap binaries (Binutils, GCC, glibc, for the traditional bootstrap and linux-libre-headers, bootstrap-mescc-tools, bootstrap-mes for the Reduced Binary Seed bootstrap, and Guile, and a tarball containing a mixture of Coreutils and other basic command-line tools): guix build bootstrap-tarballs The generated tarballs are those that should be referred to in the ‘(gnu packages bootstrap)’ module mentioned at the beginning of this section. Still here? Then perhaps by now you’ve started to wonder: when do we reach a fixed point? That is an interesting question! The answer is unknown, but if you would like to investigate further (and have significant computational and storage resources to do so), then let us know. Reducing the Set of Bootstrap Binaries ====================================== Our traditional bootstrap includes GCC, GNU Libc, Guile, etc. That’s a lot of binary code! Why is that a problem? It’s a problem because these big chunks of binary code are practically non-auditable, which makes it hard to establish what source code produced them. Every unauditable binary also leaves us vulnerable to compiler backdoors as described by Ken Thompson in the 1984 paper _Reflections on Trusting Trust_. This is mitigated by the fact that our bootstrap binaries were generated from an earlier Guix revision. Nevertheless it lacks the level of transparency that we get in the rest of the package dependency graph, where Guix always gives us a source-to-binary mapping. Thus, our goal is to reduce the set of bootstrap binaries to the bare minimum. The Bootstrappable.org web site (https://bootstrappable.org) lists on-going projects to do that. One of these is about replacing the bootstrap GCC with a sequence of assemblers, interpreters, and compilers of increasing complexity, which could be built from source starting from a simple and auditable assembler. Our first major achievement is the replacement of of GCC, the GNU C Library and Binutils by MesCC-Tools (a simple hex linker and macro assembler) and Mes (*note GNU Mes Reference Manual: (mes)Top, a Scheme interpreter and C compiler in Scheme). Neither MesCC-Tools nor Mes can be fully bootstrapped yet and thus we inject them as binary seeds. We call this the Reduced Binary Seed bootstrap, as it has halved the size of our bootstrap binaries! Also, it has eliminated the C compiler binary; i686-linux and x86_64-linux Guix packages are now bootstrapped without any binary C compiler. Work is ongoing to make MesCC-Tools and Mes fully bootstrappable and we are also looking at any other bootstrap binaries. Your help is welcome! ---------- Footnotes ---------- (1) You may notice the ‘glibc-intermediate’ label, suggesting that it is not _quite_ final, but as a good approximation, we will consider it final.  File: guix.zh_CN.info, Node: 移植, Next: 贡献, Prev: 引导, Up: Top 21 Porting to a New Platform **************************** As discussed above, the GNU distribution is self-contained, and self-containment is achieved by relying on pre-built “bootstrap binaries” (*note 引导::). These binaries are specific to an operating system kernel, CPU architecture, and application binary interface (ABI). Thus, to port the distribution to a platform that is not yet supported, one must build those bootstrap binaries, and update the ‘(gnu packages bootstrap)’ module to use them on that platform. Fortunately, Guix can _cross compile_ those bootstrap binaries. When everything goes well, and assuming the GNU tool chain supports the target platform, this can be as simple as running a command like this one: guix build --target=armv5tel-linux-gnueabi bootstrap-tarballs For this to work, it is first required to register a new platform as defined in the ‘(guix platform)’ module. A platform is making the connection between a GNU triplet (*note GNU configuration triplets: (autoconf)Specifying Target Triplets.), the equivalent SYSTEM in Nix notation, the name of the GLIBC-DYNAMIC-LINKER, and the corresponding Linux architecture name if applicable (*note Platforms::). Once the bootstrap tarball are built, the ‘(gnu packages bootstrap)’ module needs to be updated to refer to these binaries on the target platform. That is, the hashes and URLs of the bootstrap tarballs for the new platform must be added alongside those of the currently supported platforms. The bootstrap Guile tarball is treated specially: it is expected to be available locally, and ‘gnu/local.mk’ has rules to download it for the supported architectures; a rule for the new platform must be added as well. In practice, there may be some complications. First, it may be that the extended GNU triplet that specifies an ABI (like the ‘eabi’ suffix above) is not recognized by all the GNU tools. Typically, glibc recognizes some of these, whereas GCC uses an extra ‘--with-abi’ configure flag (see ‘gcc.scm’ for examples of how to handle this). Second, some of the required packages could fail to build for that platform. Lastly, the generated binaries could be broken for some reason.  File: guix.zh_CN.info, Node: 贡献, Next: 致谢, Prev: 移植, Up: Top 22 贡献 ******* 本项目是团体合作成果,我们需要您的帮助以更好地发展。请通过 邮箱和 Libera Chat IRC 网络上的 ‘#guix’ 频道联系我 们。我们欢迎您的想法、Bug 反馈、补丁和任何可能对项目有帮助的贡献。我们特 别欢迎帮助我们打包(*note 打包指导::)。 我们希望提供一个温暖、友好,并且没有骚扰的的环境,这样每个人都能尽最 大努力贡献。为了这个目的,我们的项目遵循“贡献者契约”,这个契约是根据 制定的。你可以在源代码目录里的 ‘CODE-OF-CONDUCT’ 文件里找到一份本地版。 贡献者在提交补丁和网上交流时不需要使用法律认可的名字。他们可以使用任 何名字或者假名。 * Menu: * 从Git构建:: 最新的并且最好的。 * 在安装之前运行Guix:: 黑客技巧。 * 完美的配置:: 正确的工具。 * 打包指导:: 帮助发行版成长。 * 代码风格:: 出资者的卫生状况。 * 提交补丁:: 分享你的工作。 * 跟踪程序漏洞和补丁:: 保持井井有条。 * 提交权利:: 推送到管方的仓库。 * 更新Guix软件包:: 更新Guix的软件包定义。 * 撰写文档:: 完善GNU Guix中的文档。 * 翻译 Guix:: 用您的母语翻译 Guix。  File: guix.zh_CN.info, Node: 从Git构建, Next: 在安装之前运行Guix, Up: 贡献 22.1 从Git构建 ============== 如果你想折腾Guix本身,建议使用Git仓库里最新的版本: git clone https://git.savannah.gnu.org/git/guix.git 如何确保您获得了存储库的真实副本?为此,运行‘guix git authenticate’, 将“channel introduction”(*note 调用guix git授权::)的提交和OpenPGP指纹 传递给它: git fetch origin keyring:keyring guix git authenticate 9edb3f66fd807b096b48283debdcddccfea34bad \ "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA" 此命令完成,若成功退出代码为零;否则打印一条错误消息,以非零代码退出。 如你所见,存在一个先有鸡还是蛋的问题:首先你需要安装Guix。更多情况, 您将在另一个发行版(*note 系统安装::)上安装Guix系统(*note 二进制文件安装::)或Guix;但无论如何,您都需要在安装介质上验证OpenPGP签 名。这“保证”了信任链。 设置Guix开发环境的最简单的方式当然是使用Guix!下面这些命令启动一个 shell,所有的依赖和环境变量都为折腾Guix设置好了: guix shell -D guix --pure *Note Invoking guix shell::, for more information on that command. 当从Git检出构建Guix时无法使用Guix,除安装指导(*note 需求::)里提及的 软件包之外还需要这些包。 • GNU Autoconf (https://gnu.org/software/autoconf/); • GNU Automake (https://gnu.org/software/automake/); • GNU Gettext (https://gnu.org/software/gettext/); • GNU Texinfo (https://gnu.org/software/texinfo/); • Graphviz (https://www.graphviz.org/); • GNU Help2man(可选) (https://www.gnu.org/software/help2man/)。 On Guix, extra dependencies can be added by instead running ‘guix shell’: guix shell -D guix help2man git strace --pure From there you can generate the build system infrastructure using Autoconf and Automake: 引导 If you get an error like this one: configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES 它可能意味着Autoconf无法找到由pkg-config提供的‘pkg.m4’。请确保‘pkg.m4’可 用。由Guile提供的‘guile.m4’宏也类似。假如你的Automake安装在 ‘/usr/local’,那么它不会从‘/usr/share’里寻找‘.m4’文件。这种情况下,你必 须执行下面这个命令: export ACLOCAL_PATH=/usr/share/aclocal 参考*Note (automake)Macro Search Path::. Then, run: ./configure --localstatedir=/var ... where ‘/var’ is the normal ‘localstatedir’ value (*note 仓库::, for information about this). Note that you will probably not run ‘make install’ at the end (you don’t have to) but it’s still important to pass the right ‘localstatedir’. Finally, you can build Guix and, if you feel so inclined, run the tests (*note 运行测试套件::): make make check If anything fails, take a look at installation instructions (*note 安装::) or send a message to the mailing list . From there on, you can authenticate all the commits included in your checkout by running: make authenticate The first run takes a couple of minutes, but subsequent runs are faster. Or, when your configuration for your local Git repository doesn’t match the default one, you can provide the reference for the ‘keyring’ branch through the variable ‘GUIX_GIT_KEYRING’. The following example assumes that you have a Git remote called ‘myremote’ pointing to the official repository: make authenticate GUIX_GIT_KEYRING=myremote/keyring 注: You are advised to run ‘make authenticate’ after every ‘git pull’ invocation. This ensures you keep receiving valid changes to the repository. After updating the repository, ‘make’ might fail with an error similar to the following example: error: failed to load 'gnu/packages/dunst.scm': ice-9/eval.scm:293:34: In procedure abi-check: #>: record ABI mismatch; recompilation needed This means that one of the record types that Guix defines (in this example, the ‘origin’ record) has changed, and all of guix needs to be recompiled to take that change into account. To do so, run ‘make clean-go’ followed by ‘make’.  File: guix.zh_CN.info, Node: 在安装之前运行Guix, Next: 完美的配置, Prev: 从Git构建, Up: 贡献 22.2 在安装之前运行Guix ======================= 为了保持一个合适的工作环境,你会发现在你的本地代码树里测试修改而不用安装 它们会很有用。TODO: So that you can distinguish between your “end-user” hat and your “motley” costume. To that end, all the command-line tools can be used even if you have not run ‘make install’. To do that, you first need to have an environment with all the dependencies available (*note 从Git构建::), and then simply prefix each command with ‘./pre-inst-env’ (the ‘pre-inst-env’ script lives in the top build tree of Guix; it is generated by running ‘./bootstrap’ followed by ‘./configure’). As an example, here is how you would build the ‘hello’ package as defined in your working tree (this assumes ‘guix-daemon’ is already running on your system; it’s OK if it’s a different version): $ ./pre-inst-env guix build hello 同样,一个使用 Guix 模块的 Guile 会话的例子: $ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' ;;; ("x86_64-linux") ... and for a REPL (*note Using Guix Interactively::): $ ./pre-inst-env guile scheme@(guile-user)> ,use(guix) scheme@(guile-user)> ,use(gnu) scheme@(guile-user)> (define snakes (fold-packages (lambda (package lst) (if (string-prefix? "python" (package-name package)) (cons package lst) lst)) '())) scheme@(guile-user)> (length snakes) $1 = 361 If you are hacking on the daemon and its supporting code or if ‘guix-daemon’ is not already running on your system, you can launch it straight from the build tree(1): $ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild ‘pre-inst-env’脚本设置为此好了所有必要的的环境变量,包括‘PATH’和 ‘GUILE_LOAD_PATH’。 ‘./pre-inst-env guix pull’ _不_ 会更新本地源代码树,它只更新符号链接 ‘~/.config/guix/current’ (*note 调用guix pull::)。如果你想更新本地源代码 树,请运行‘git pull’。 Sometimes, especially if you have recently updated your repository, running ‘./pre-inst-env’ will print a message similar to the following example: ;;; note: source file /home/user/projects/guix/guix/progress.scm ;;; newer than compiled /home/user/projects/guix/guix/progress.go This is only a note and you can safely ignore it. You can get rid of the message by running ‘make -j4’. Until you do, Guile will run slightly slower because it will interpret the code instead of using prepared Guile object (‘.go’) files. You can run ‘make’ automatically as you work using ‘watchexec’ from the ‘watchexec’ package. For example, to build again each time you update a package file, run ‘watchexec -w gnu/packages -- make -j4’. ---------- Footnotes ---------- (1) The ‘-E’ flag to ‘sudo’ guarantees that ‘GUILE_LOAD_PATH’ is correctly set such that ‘guix-daemon’ and the tools it uses can find the Guile modules they need.  File: guix.zh_CN.info, Node: 完美的配置, Next: 打包指导, Prev: 在安装之前运行Guix, Up: 贡献 22.3 完美的配置 =============== 折腾 Guix 的完美配置也是折腾 Guile 的完美配置 *note (guile)Using Guile in Emacs::)。首先,你需要的不仅是一个编辑器,你需要 Emacs (https://www.gnu.org/software/emacs),以及美妙的 Geiser (http://nongnu.org/geiser/)。为此,运行: guix install emacs guile emacs-geiser emacs-geiser-guile Geiser 允许在 Emacs 里进行交互式的、增长式的开发:buffer 里的代码补全 和执行,获取一行的文档 (docstrings),上下文敏感的补全,‘M-.’ 跳转到对象 定义,测试代码的 REPL,及更多(*note (geiser)介绍::)。为了方便的 Guix 开 发,请确保修改 Guile 的加载路径 (load path) 以使其能从你的项目里找到源代 码文件: ;; 假设Guix项目在 ~/src/guix. (with-eval-after-load 'geiser-guile (add-to-list 'geiser-guile-load-path "~/src/guix")) 真正编辑代码时别忘了 Emacs 自带了方便的 Scheme 模式。而且,一定不要错 过 Paredit (https://www.emacswiki.org/emacs/ParEdit)。它提供了直接操作语 法树的的功能,例如,用 S- 表达式替换父节点,为 S- 表达式添加、删除前后的 括号,删除后面的 S- 表达式,等等。 We also provide templates for common git commit messages and package definitions in the ‘etc/snippets’ directory. These templates can be used to expand short trigger strings to interactive text snippets. If you use YASnippet (https://joaotavora.github.io/yasnippet/), you may want to add the ‘etc/snippets/yas’ snippets directory to the YAS-SNIPPET-DIRS variable. If you use Tempel (https://github.com/minad/tempel/), you may want to add the ‘etc/snippets/tempel/*’ path to the TEMPEL-PATH variable in Emacs. ;; Assuming the Guix checkout is in ~/src/guix. ;; Yasnippet configuration (with-eval-after-load 'yasnippet (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets/yas")) ;; Tempel configuration (with-eval-after-load 'tempel ;; Ensure tempel-path is a list -- it may also be a string. (unless (listp 'tempel-path) (setq tempel-path (list tempel-path))) (add-to-list 'tempel-path "~/src/guix/etc/snippets/tempel/*")) commit信息片段显示staged文件需要依赖Magit (https://magit.vc/)。编辑 commit信息时,输入‘add’,然后按‘TAB’就可以插入一段用于新增软件包的模板; 输入‘update’,然后按‘TAB’可以插入一段更新软件包的模板;输入‘https’然后按 ‘TAB’可以插入一段修改主页URI为HTTPS的模板。 ‘scheme-mode’最重要的模板可以通过输入‘package...’,然后按‘TAB’触发。 这个片段还插入了触发字符串‘origin...’,以进一步展开。‘origin’片段更进一 步的可能插入其它以‘...’结尾的触发字符串,它们可以被继续展开。 We additionally provide insertion and automatic update of a copyright in ‘etc/copyright.el’. You may want to set your full name, mail, and load a file. (setq user-full-name "Alice Doe") (setq user-mail-address "alice@mail.org") ;; Assuming the Guix checkout is in ~/src/guix. (load-file "~/src/guix/etc/copyright.el") To insert a copyright at the current line invoke ‘M-x guix-copyright’. To update a copyright you need to specify a ‘copyright-names-regexp’. (setq copyright-names-regexp (format "%s <%s>" user-full-name user-mail-address)) You can check if your copyright is up to date by evaluating ‘M-x copyright-update’. If you want to do it automatically after each buffer save then add ‘(add-hook 'after-save-hook 'copyright-update)’ in Emacs.  File: guix.zh_CN.info, Node: 打包指导, Next: 代码风格, Prev: 完美的配置, Up: 贡献 22.4 打包指导 ============= 这个GNU发行版正在开发的早期阶段,可能缺少一些你喜欢的软件。这个章节介绍 你可以怎样帮助这个发行版成长。 自由软件通常以“源代码包”的形式分发,通常是包含完整代码的‘tar.gz’包。 添加软件包到这个发行版意味着两件事:添加描述如何构建包的“配方”和一系列依 赖软件,以及添加配方之外的“软件包元数据”,如一段文字描述和证书信息。 在Guix里所有这些信息都包含在“软件包定义”里。软件包定义提供了软件包的 高层视角。它们使用Scheme编程语言编写,事实上,对每个软件包我们都定义一个 绑定到软件包定义的的变量,并且从模块(*note 软件包模块::)中导出那个变量 。然而,深入的Scheme知识_不_是创建软件包的前提条件。若要了解软件包的更多 信息,*note 定义软件包::。 一旦软件包定义准备好了,并且包存在Guix代码树的一个文件里,你可以用 ‘guix build’ (*note 调用guix build::)命令测试它。假设这个新软件包的名字 叫做‘gnew’,你可以在Guix构建树里运行这个命令(*note 在安装之前运行Guix::): ./pre-inst-env guix build gnew --keep-failed 使用‘--keep-failed’参数会保留失败的构建树,这可以使调试构建错误更容易 。‘--log-file’也是一个调试时很有用的参数,它可以用来访问构建日志。 如果‘guix’命令找不到这个软件包,那可能是因为源文件包含语法错误,或者 缺少导出软件包的‘define-public’语句。为了查找错误,你可以用Guile导入这个 模块以了解这个错误的详情: ./pre-inst-env guile -c '(use-modules (gnu packages gnew))' Once your package builds correctly, please send us a patch (*note 提交补丁::). Well, if you need help, we will be happy to help you too. Once the patch is committed in the Guix repository, the new package automatically gets built on the supported platforms by our continuous integration system (https://ci.guix.gnu.org). Users can obtain the new package definition simply by running ‘guix pull’ (*note 调用guix pull::). When ‘ci.guix.gnu.org’ is done building the package, installing the package automatically downloads binaries from there (*note substitutes::). The only place where human intervention is needed is to review and apply the patch. * Menu: * 软件自由:: 什么可以进入这个发行版。 * 软件包命名:: 名字里包含什么? * 版本号:: 当名字不够时。 * 简介和描述:: 帮助用户寻找合适的软件包。 * Snippets versus Phases:: Whether to use a snippet, or a build phase. * Emacs Packages:: Your Elisp fix. * Python模块:: 接触英式的喜剧。 * Perl模块:: 小珍珠。 * Java包:: 喝咖啡休息。 * Rust Crates:: 谨防氧化。 * Elm Packages:: Trees of browser code * 字体:: 字体的乐趣。  File: guix.zh_CN.info, Node: 软件自由, Next: 软件包命名, Up: 打包指导 22.4.1 软件自由 --------------- 开发 GNU 操作系统是为了用户拥有计算的自由。GNU是“自由软件”,这意味着它有 四项重要的自由 (https://www.gnu.org/philosophy/free-sw.html):运行程序的 自由,以源代码形式学习和修改程序的自由,原样重新分发副本的自由,和分发修 改后的版本的自由。GNU 发行版里包含的软件包只提供遵守这四项自由的软件。 此外,GNU 发行版遵循自由软件发行版准则 (https://www.gnu.org/distros/free-system-distribution-guidelines.html)。 这些准则拒绝非自由的固件和对非自由软件的推荐,并讨论解决商标和专利的方法 。 某些上游的软件包源代码包含一小部分违反上述准则的可选的子集,比如这个 子集本身就是非自由代码。这时,这些讨厌的代码需要用合适的补丁或者软件包定 义(*note 定义软件包::)里的‘origin’里的代码片段移除。这样,‘guix build --source’就可以返回自由的源代码而不是未经修改的上游源代码。  File: guix.zh_CN.info, Node: 软件包命名, Next: 版本号, Prev: 软件自由, Up: 打包指导 22.4.2 软件包命名 ----------------- 一个软件包事实上有两个名字:第一个是_Scheme变量_的名字,即用 ‘define-public’定义的名字。通过这个名字,软件包可以被Scheme代码找到,如 用作其它软件包的输入。第二个名字是软件包定义里的‘name’属性的字符串值。这 个名字用于软件包管理命令,如:‘guix package’,‘guix build’。 两个名字通常是相同的,常是上游项目名字转成小写字母并把下划线替换成连 字符的结果。比如,GNUnet转成‘gnunet’,SDL_net转成‘sdl-net’。 A noteworthy exception to this rule is when the project name is only a single character, or if an older maintained project with the same name already exists—regardless of whether it has already been packaged for Guix. Use common sense to make such names unambiguous and meaningful. For example, Guix’s package for the shell called “s” upstream is ‘s-shell’ and _not_ ‘s’. Feel free to ask your fellow hackers for inspiration. 我们不给库软件包添加‘lib’前缀,除非它是项目官方名字的一部分。但是 *note Python模块::和*note Perl模块::有关于Python和Perl语言的特殊规则。 字体软件包的名字处理起来不同,*note 字体::.  File: guix.zh_CN.info, Node: 版本号, Next: 简介和描述, Prev: 软件包命名, Up: 打包指导 22.4.3 版本号 ------------- 我们通常只为每个自由软件的最新版本打包。但是有时候,比如对于版本不兼容的 库,需要有同一个软件包的两个或更多版本。它们需要使用不同的Scheme变量名。 我们为最新的版本使用*note 软件包命名::里规定的名字,旧的版本使用加上后缀 的名字,后缀是‘-’和可以区分开版本号的版本号的最小前缀。 软件包定义里的名字对于同一个软件包的所有版本都是相同的,并且不含有版 本号。 例如,GTK+的2.24.20和3.9.12两个版本可以这样打包: (define-public gtk+ (package (name "gtk+") (version "3.9.12") ...)) (define-public gtk+-2 (package (name "gtk+") (version "2.24.20") ...)) 如果我们还需要GTK+ 3.8.2,就这样打包 (define-public gtk+-3.8 (package (name "gtk+") (version "3.8.2") ...)) 有时候,我们为软件包上游的版本控制系统(VCS)的快照而不是正式发布版打 包。这是特殊情况,因为决定哪个是稳定版的权力应该属于上游开发者。然而,有 时候这是必须的。那么,我们该如何决定写在‘version’里的版本号呢? 显然,我们需要让VCS快照的commit ID在版本号中体现出来,但是我们也需要 确保版本号单调递增,以便‘guix package --upgrade’决定哪个版本号更新。由于 commit ID,尤其是Git的commit ID,不是单调递增的,我们添加一个每次升级快 照时都手动增长的revision数字。最后的版本号字符串看起来是这样: 2.0.11-3.cabba9e ^ ^ ^ | | `-- 上游的commit ID | | | `--- Guix软件包的revision | 最新的上游版本号 把‘版本号’里的commit ID截短,比如只取7个数字,是一个好主意。它避免了 美学上的烦恼(假设美学在这里很重要),以及操作系统限制引起的问题(比如 Linux内核的127字节)。尽管如此,在‘origin’里最好使用完整的commit ID,以 避免混淆。通常一个软件包应该看起来是下面这样: (define my-package (let ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7") (revision "1")) ;Guix软件包的revision (package (version (git-version "0.9" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "git://example.org/my-package.git") (commit commit))) (sha256 (base32 "1mbikn...")) (file-name (git-file-name name version)))) ;; ... ))) -- Scheme Procedure: git-version VERSION REVISION COMMIT Return the version string for packages using ‘git-fetch’. (git-version "0.2.3" "0" "93818c936ee7e2f1ba1b315578bde363a7d43d05") ⇒ "0.2.3-0.93818c9" -- Scheme Procedure: hg-version VERSION REVISION CHANGESET Return the version string for packages using ‘hg-fetch’. It works in the same way as ‘git-version’.  File: guix.zh_CN.info, Node: 简介和描述, Next: Snippets versus Phases, Prev: 版本号, Up: 打包指导 22.4.4 简介和描述 ----------------- 我们已经看到,GNU Guix里的每个软件包都包含一个简介(synopsis)和一个描述 (description)(*note 定义软件包::)。简介和描述很重要:它们是‘guix package --search’搜索的信息,并且是帮助用户决定一个软件包是否符合自己需 求的重要信息。因此,打包的人应该关注怎样写它们的内容。 简介必须以大写字母开头,并且不能以句号结尾。它们不能以 “a” 或者 “the” 等没有意义的词开头。例如 “File-frobbing tool” 要比 “A tool that frobs files” 更好。简介需要说明软件包是什么--如 “Core GNU utilities (file, text, shell)”,或者它的用途--如 GNU grep 的简介是 “Print lines matching a pattern”。 记住,简介必须能被广大的听众理解。例如,“以SAM格式修改对齐”可能对经验 丰富的生物信息科研工作者来说能理解,但是对普通对听众则是无用的甚至是令人 误解的。简介最好说明软件包应用的领域。在这个例子中,应该这样描述“修改核 苷酸序列的对齐格式”,这会让用户更容易判断这是不是他们想要的。 描述应该在5至10句话之间。使用完整的句子,并且避免在未介绍的情况下使用 缩写。请避免推广营销性对词汇,如“世界领先”,“行业最强”,“下一代”,并且避 免高级的形容词,如“最先进的”–他们对用户寻找软件包是无用的,甚至是可疑的 。相反的,尽量务实,提及用例和功能。 Descriptions can include Texinfo markup, which is useful to introduce ornaments such as ‘@code’ or ‘@dfn’, bullet lists, or hyperlinks (*note (texinfo)Overview::). However you should be careful when using some characters for example ‘@’ and curly braces which are the basic special characters in Texinfo (*note (texinfo)Special Characters::). User interfaces such as ‘guix show’ take care of rendering it appropriately. Synopses and descriptions are translated by volunteers at Weblate (https://translate.fedoraproject.org/projects/guix/packages) so that as many users as possible can read them in their native language. User interfaces search them and display them in the language specified by the current locale. 为了让‘xgettext’可以把它们提取成待翻译的字符串,简介和描述_必须是文字 字符串_。这意味着你不能使用‘string-append’或‘format’来合成字符串: (package ;; ... (synopsis "这是可以翻译的") (description (string-append "这是" "*不可以*" "翻译的"))) 翻译是很繁重的工作,所以,作为打包者请更加注意你的简介和介绍,每一个 改动都会增加翻译的工作量。为了帮助他们,你可以插入这类可以被他们看到的建 议和指示(*note (gettext)xgettext Invocation::): ;; TRANSLATORS: "X11 resize-and-rotate"不需要翻译。 (description "ARandR为X11 resize-and-rotate (RandR)扩展提供简单的图形界面。...")  File: guix.zh_CN.info, Node: Snippets versus Phases, Next: Emacs Packages, Prev: 简介和描述, Up: 打包指导 22.4.5 Snippets versus Phases ----------------------------- The boundary between using an origin snippet versus a build phase to modify the sources of a package can be elusive. Origin snippets are typically used to remove unwanted files such as bundled libraries, nonfree sources, or to apply simple substitutions. The source derived from an origin should produce a source that can be used to build the package on any system that the upstream package supports (i.e., act as the corresponding source). In particular, origin snippets must not embed store items in the sources; such patching should rather be done using build phases. Refer to the ‘origin’ record documentation for more information (*note origin参考手册::).  File: guix.zh_CN.info, Node: Emacs Packages, Next: Python模块, Prev: Snippets versus Phases, Up: 打包指导 22.4.6 Emacs Packages --------------------- Emacs packages should preferably use the Emacs build system (*note emacs-build-system::), for uniformity and the benefits provided by its build phases, such as the auto-generation of the autoloads file and the byte compilation of the sources. Because there is no standardized way to run a test suite for Emacs packages, tests are disabled by default. When a test suite is available, it should be enabled by setting the ‘#:tests?’ argument to ‘#true’. By default, the command to run the test is ‘make check’, but any command can be specified via the ‘#:test-command’ argument. The ‘#:test-command’ argument expects a list containing a command and its arguments, to be invoked during the ‘check’ phase. The Elisp dependencies of Emacs packages are typically provided as ‘propagated-inputs’ when required at run time. As for other packages, build or test dependencies should be specified as ‘native-inputs’. Emacs packages sometimes depend on resources directories that should be installed along the Elisp files. The ‘#:include’ argument can be used for that purpose, by specifying a list of regexps to match. The best practice when using the ‘#:include’ argument is to extend rather than override its default value (accessible via the ‘%default-include’ variable). As an example, a yasnippet extension package typically include a ‘snippets’ directory, which could be copied to the installation directory using: #:include (cons "^snippets/" %default-include) When encountering problems, it is wise to check for the presence of the ‘Package-Requires’ extension header in the package main source file, and whether any dependencies and their versions listed therein are satisfied.  File: guix.zh_CN.info, Node: Python模块, Next: Perl模块, Prev: Emacs Packages, Up: 打包指导 22.4.7 Python模块 ----------------- 我们目前为Python 2和Python 3打包,如*note 版本号::的规则所述,它们的 Scheme变量名分别是‘python-2’和‘python’。为了避免和其他编程语言的冲突, Python模块的软件包名字最好含有‘python’。 Some modules are compatible with only one version of Python, others with both. If the package Foo is compiled with Python 3, we name it ‘python-foo’. If it is compiled with Python 2, we name it ‘python2-foo’. Packages should be added when they are necessary; we don’t add Python 2 variants of the package unless we are going to use them. 如果一个项目的名字已经含有‘python’这个单词,我们把它丢掉;例如, python-dateutil模块打包后的名字是‘python-dateutil’和‘python2-dateutil’。 如果项目的名字以‘py’开头(如 ‘pytz’),我们把它保留,并且添加上面所述的 前缀。 注: Currently there are two different build systems for Python packages in Guix: PYTHON-BUILD-SYSTEM and PYPROJECT-BUILD-SYSTEM. For the longest time, Python packages were built from an informally specified ‘setup.py’ file. That worked amazingly well, considering Python’s success, but was difficult to build tooling around. As a result, a host of alternative build systems emerged and the community eventually settled on a formal standard (https://peps.python.org/pep-0517/) for specifying build requirements. PYPROJECT-BUILD-SYSTEM is Guix’s implementation of this standard. It is considered “experimental” in that it does not yet support all the various PEP-517 _build backends_, but you are encouraged to try it for new Python packages and report any problems. It will eventually be deprecated and merged into PYTHON-BUILD-SYSTEM. 22.4.7.1 指定依赖 ................. Dependency information for Python packages is usually available in the package source tree, with varying degrees of accuracy: in the ‘pyproject.toml’ file, the ‘setup.py’ file, in ‘requirements.txt’, or in ‘tox.ini’ (the latter mostly for test dependencies). 你在写软件包配方时的任务是把这些依赖转换成相应的“输入”(*note inputs: 软件包引用.)。尽管‘pypi’导入工具通常可以做得很好(*note 调用guix import::),你可能想检查下面这个清单,以决定每个依赖放在哪儿。 • We currently package Python with ‘setuptools’ and ‘pip’ installed per default. This is about to change, and users are encouraged to use ‘python-toolchain’ if they want a build environment for Python. ‘guix lint’ will warn if ‘setuptools’ or ‘pip’ are added as native-inputs because they are generally not necessary. • 运行时需要的Python依赖要放进‘propagated-inputs’。它们通常由 ‘setup.py’文件里的‘install_requires’关键字或‘requirements.txt’文件 定义。 • Python packages required only at build time—e.g., those listed under ‘build-system.requires’ in ‘pyproject.toml’ or with the ‘setup_requires’ keyword in ‘setup.py’—or dependencies only for testing—e.g., those in ‘tests_require’ or ‘tox.ini’—go into ‘native-inputs’. The rationale is that (1) they do not need to be propagated because they are not needed at run time, and (2) in a cross-compilation context, it’s the “native” input that we’d want. 例如‘pytest’,‘mock’,‘nose’测试框架。当然,如果在运行时需要这里的 任何一个包,它需要被加进‘propagated-inputs’。 • 任何不属于上述类别的包都要被加进‘inputs’,如,构建含有C语言扩展的 Python包所需的程序和C语言库。 • 如果一个Python软件包由可选的依赖(‘extras_require’),由你根据它们 的性价比(用处/负担)决定是否添加它们(*note ‘guix size’: 提交补丁.)。  File: guix.zh_CN.info, Node: Perl模块, Next: Java包, Prev: Python模块, Up: 打包指导 22.4.8 Perl模块 --------------- Perl程序和其它软件包的命名规则类似,用小写的上游名字命名。对于仅包含一个 类的Perl包,我们使用小写的类名,把所有的‘::’替换成破折号,并且添加 ‘perl-’前缀。所以类‘XML::Parser’变成‘perl-xml-parser’。包含多个类的模块 保留它们上游的名字,并且添加‘perl-’前缀。这类模块的名字通常含有‘perl’, 这个单词需要被删掉。例如,‘libwww-perl’变成‘perl-libwww’。  File: guix.zh_CN.info, Node: Java包, Next: Rust Crates, Prev: Perl模块, Up: 打包指导 22.4.9 Java包 ------------- Java程序和其它软件包的命名规则类似,用小写的上游名字命名。 为了避免和其它编程语言混淆和命名冲突,Java软件包的名字最好有‘java-’前 缀。如果一个项目的名字已经含有‘java’,我们把它删掉;例如,‘ngsjava’打包 后的名字是‘java-ngs’。 对于仅包含一个或很少几个类的Java软件包,我们使用小写的类名,把所有的 ‘.’替换成破折号,并且添加‘java-’前缀。因此,类‘apache.commons.cli’打包后 的名字是‘java-apache-commons-cli’。  File: guix.zh_CN.info, Node: Rust Crates, Next: Elm Packages, Prev: Java包, Up: 打包指导 22.4.10 Rust Crates ------------------- Rust 程序和其它软件包的命名规则类似,用小写的上游名字命名。 To prevent namespace collisions we prefix all other Rust packages with the ‘rust-’ prefix. The name should be changed to lowercase as appropriate and dashes should remain in place. In the rust ecosystem it is common for multiple incompatible versions of a package to be used at any given time, so all package definitions should have a versioned suffix. The versioned suffix is the left-most non-zero digit (and any leading zeros, of course). This follows the “caret” version scheme intended by Cargo. Examples ‘rust-clap-2’, ‘rust-rand-0.6’. Because of the difficulty in reusing rust packages as pre-compiled inputs for other packages the Cargo build system (*note ‘cargo-build-system’: 构建系统.) presents the ‘#:cargo-inputs’ and ‘cargo-development-inputs’ keywords as build system arguments. It would be helpful to think of these as similar to ‘propagated-inputs’ and ‘native-inputs’. Rust ‘dependencies’ and ‘build-dependencies’ should go in ‘#:cargo-inputs’, and ‘dev-dependencies’ should go in ‘#:cargo-development-inputs’. If a Rust package links to other libraries then the standard placement in ‘inputs’ and the like should be used. Care should be taken to ensure the correct version of dependencies are used; to this end we try to refrain from skipping the tests or using ‘#:skip-build?’ when possible. Of course this is not always possible, as the package may be developed for a different Operating System, depend on features from the Nightly Rust compiler, or the test suite may have atrophied since it was released.  File: guix.zh_CN.info, Node: Elm Packages, Next: 字体, Prev: Rust Crates, Up: 打包指导 22.4.11 Elm Packages -------------------- Elm applications can be named like other software: their names need not mention Elm. Packages in the Elm sense (see ‘elm-build-system’ under *note 构建系统::) are required use names of the format AUTHOR‘/’PROJECT, where both the AUTHOR and the PROJECT may contain hyphens internally, and the AUTHOR sometimes contains uppercase letters. To form the Guix package name from the upstream name, we follow a convention similar to Python packages (*note Python模块::), adding an ‘elm-’ prefix unless the name would already begin with ‘elm-’. In many cases we can reconstruct an Elm package’s upstream name heuristically, but, since conversion to a Guix-style name involves a loss of information, this is not always possible. Care should be taken to add the ‘'upstream-name’ property when necessary so that ‘guix import elm’ will work correctly (*note 调用guix import::). The most notable scenarios when explicitly specifying the upstream name is necessary are: 1. When the AUTHOR is ‘elm’ and the PROJECT contains one or more hyphens, as with ‘elm/virtual-dom’; and 2. When the AUTHOR contains hyphens or uppercase letters, as with ‘Elm-Canvas/raster-shapes’—unless the AUTHOR is ‘elm-explorations’, which is handled as a special case, so packages like ‘elm-explorations/markdown’ do _not_ need to use the ‘'upstream-name’ property. The module ‘(guix build-system elm)’ provides the following utilities for working with names and related conventions: -- Scheme procedure: elm-package-origin ELM-NAME VERSION HASH Returns a Git origin using the repository naming and tagging regime required for a published Elm package with the upstream name ELM-NAME at version VERSION with sha256 checksum HASH. For example: (package (name "elm-html") (version "1.0.0") (source (elm-package-origin "elm/html" version (base32 "15k1679ja57vvlpinpv06znmrxy09lbhzfkzdc89i01qa8c4gb4a"))) ...) -- Scheme procedure: elm->package-name ELM-NAME Returns the Guix-style package name for an Elm package with upstream name ELM-NAME. Note that there is more than one possible ELM-NAME for which ‘elm->package-name’ will produce a given result. -- Scheme procedure: guix-package->elm-name PACKAGE Given an Elm PACKAGE, returns the possibly-inferred upstream name, or ‘#f’ the upstream name is not specified via the ‘'upstream-name’ property and can not be inferred by ‘infer-elm-package-name’. -- Scheme procedure: infer-elm-package-name GUIX-NAME Given the GUIX-NAME of an Elm package, returns the inferred upstream name, or ‘#f’ if the upstream name can’t be inferred. If the result is not ‘#f’, supplying it to ‘elm->package-name’ would produce GUIX-NAME.  File: guix.zh_CN.info, Node: 字体, Prev: Elm Packages, Up: 打包指导 22.4.12 字体 ------------ 对于通常不会被用户安装用于排版的字体,或者随更大的软件包分发的字体,我们 使用通常的命名规则。例如,这适用于X.Org系统附带的字体或TeX Live附带的字 体。 为了让用户更容易搜索字体,其它仅含有字体的软件包按以下规则命名,不管 上游的包名是什么。 仅含有一个字体家族的软件包需要以‘font-’开头;如果作者名字已知,则添加 作者名字和‘-’,接着是字体家族名字(把空格替换成破折号),(和通常一样, 把所有的大写字母转换成小写字母)。例如,由SIL设计的Gentium字体家族打包后 的名字是‘font-sil-gentium’。 对于一个含有多个字体家族的软件包,用集合的名字替换字体家族的名字。例 如,Liberation字体含有三个家族,Liberation Sans、Liberation Serif和 Liberation Mono。它们可以用‘font-liberation-sans’等名字分开打包;但是由 于它们以一个共同的名字分发,我们倾向于以‘font-liberation’名字统一打包。 当同一个字体家族或字体集合的不同格式分开打包时,把破折号和格式(缩写 )添加在软件包名字后面。我们用‘-ttf’代表TrueType字体,‘-otf’代表 OpenType字体,‘-type1’代表PostScript Type 1字体。  File: guix.zh_CN.info, Node: 代码风格, Next: 提交补丁, Prev: 打包指导, Up: 贡献 22.5 代码风格 ============= 总的来说,我们的代码遵循GNU代码规范(*note (standards)Top::)。但是,这 个规范对Scheme的介绍不多,所以这儿提供一些额外的规则。 * Menu: * 编程范例:: 怎样合成元素。 * 模块:: 在哪里保存代码? * 数据类型和模式匹配:: 实现数据结构。 * 格式化代码:: 书写规范。  File: guix.zh_CN.info, Node: 编程范例, Next: 模块, Up: 代码风格 22.5.1 编程范例 --------------- Guix里的Scheme代码是以纯函数的风格写的。一个例外是有关输入/输出的代码, 和实现底层概念的过程,如‘memoize’过程。  File: guix.zh_CN.info, Node: 模块, Next: 数据类型和模式匹配, Prev: 编程范例, Up: 代码风格 22.5.2 模块 ----------- 用于构建的Guile模块必须放在‘(guix build ...)’命名空间里。它们不允许引用 其它Guix或GNU模块。但是,主机端(host-side)模块可以使用构建端( build-side)模块。 关于更广的GNU系统的模块应该在‘(gnu ...)’命名空间里而不是‘(guix ...)’。  File: guix.zh_CN.info, Node: 数据类型和模式匹配, Next: 格式化代码, Prev: 模块, Up: 代码风格 22.5.3 数据类型和模式匹配 ------------------------- 经典的Lisp倾向于用列表表示所有的东西,然后用‘car’,‘cdr’,‘cadr’等手动浏 览它们。这种风格有几个问题,特别是难以阅读,易出错,并且妨碍生成合适的类 型错误报告。 Guix code should define appropriate data types (for instance, using ‘define-record-type*’) rather than abuse lists. In addition, it should use pattern matching, via Guile’s ‘(ice-9 match)’ module, especially when matching lists (*note (guile)Pattern Matching::); pattern matching for records is better done using ‘match-record’ from ‘(guix records)’, which, unlike ‘match’, verifies field names at macro-expansion time.  File: guix.zh_CN.info, Node: 格式化代码, Prev: 数据类型和模式匹配, Up: 代码风格 22.5.4 格式化代码 ----------------- When writing Scheme code, we follow common wisdom among Scheme programmers. In general, we follow the Riastradh’s Lisp Style Rules (https://mumble.net/~campbell/scheme/style.txt). This document happens to describe the conventions mostly used in Guile’s code too. It is very thoughtful and well written, so please do read it. 一些Guix添加的special form,如‘substitute*’宏,有特殊的缩进规则。它们 的规则在‘.dir-locals.el’文件里定义,Emacs会自动使用。另外,Emacs-Guix提 供的‘guix-devel-mode’模式可以正确地缩进和高亮Guix代码(*note (emacs-guix)开发::)。 如果你不使用Emacs,请确保让你的编辑器知道这些规则。为了自动地缩进软件 包定义,你也可以运行: ./pre-inst-env guix style PACKAGE *Note Invoking guix style::, for more information. 如果你用Vim编辑代码,我们推荐你运行‘:set autoindent’,以使你在输入时 自动缩进代码。另外,‘paredit.vim’ (https://www.vim.org/scripts/script.php?script_id=3998)可以帮你处理括号 。 我们要求所有的顶级过程附带一个docstring。这个要求对‘(guix build ...)’命名空间里的简单的私有过程可以放宽。 过程不应该有多于四个定位参数。对于接收多于四个定位参数的过程应使用关 键字参数。  File: guix.zh_CN.info, Node: 提交补丁, Next: 跟踪程序漏洞和补丁, Prev: 代码风格, Up: 贡献 22.6 提交补丁 ============= Development is done using the Git distributed version control system. Thus, access to the repository is not strictly necessary. We welcome contributions in the form of patches as produced by ‘git format-patch’ sent to the mailing list (*note (git)Submitting patches to a project::). Contributors are encouraged to take a moment to set some Git repository options (*note 配置Git::) first, which can improve the readability of patches. Seasoned Guix developers may also want to look at the section on commit access (*note 提交权利::). This mailing list is backed by a Debbugs instance, which allows us to keep track of submissions (*note 跟踪程序漏洞和补丁::). Each message sent to that mailing list gets a new tracking number assigned; people can then follow up on the submission by sending email to ‘ISSUE_NUMBER@debbugs.gnu.org’, where ISSUE_NUMBER is the tracking number (*note 发送补丁系列::). 请以ChangeLog格式(*note (standards)Change Logs::)写commit日志;你可 以浏览commit历史里的例子。 提交添加或者修改软件包定义的补丁之前,请过一遍这个检查列表: 1. 如果软件包的作者为发布的文件包提供了密码学签名,请验证文件的真实性 。对于独立的 GPG 签名文件,这可以通过 ‘gpg --verify’ 命令完成。 2. 花些时间为软件包提供一个合适的简介和描述。更多指导,*Note 简介和描述::。 3. 运行‘guix lint 软件包’,软件包是新添加的或修改过的软件包的名字,修 复它报告的错误(*note 调用guix lint::)。 4. Run ‘guix style PACKAGE’ to format the new package definition according to the project’s conventions (*note Invoking guix style::). 5. 用‘guix build 软件包’命令确保这个软件包可以在你的平台上构建。 6. We recommend you also try building the package on other supported platforms. As you may not have access to actual hardware platforms, we recommend using the ‘qemu-binfmt-service-type’ to emulate them. In order to enable it, add the ‘virtualization’ service module and the following service to the list of services in your ‘operating-system’ configuration: (service qemu-binfmt-service-type (qemu-binfmt-configuration (platforms (lookup-qemu-platforms "arm" "aarch64")))) 然后重新配置你的系统。 You can then build packages for different platforms by specifying the ‘--system’ option. For example, to build the "hello" package for the armhf or aarch64 architectures, you would run the following commands, respectively: guix build --system=armhf-linux --rounds=2 hello guix build --system=aarch64-linux --rounds=2 hello 7. 请确保软件包里不捆绑出现已经被打过包的软件的副本。 有时,软件包为了方便用户,捆绑了依赖库的源代码。然而,当依赖库在发 行版里已经存在时,做为一个发行版,我们希望确保这些软件包使用发行版 里已有的副本。这提高资源使用率(依赖库只构建一次,存储一份),并且 使发行版更容易管理,如仅在一个地方对某个软件包进行安全更新就可以影 响整个系统--捆绑软件会妨碍这么做。 8. Take a look at the profile reported by ‘guix size’ (*note 调用guix size::). This will allow you to notice references to other packages unwillingly retained. It may also help determine whether to split the package (*note 有多个输出的软件包::), and which optional dependencies should be used. In particular, avoid adding ‘texlive’ as a dependency: because of its extreme size, use the ‘texlive-tiny’ package or ‘texlive-union’ procedure instead. 9. For important changes, check that dependent packages (if applicable) are not affected by the change; ‘guix refresh --list-dependent PACKAGE’ will help you do that (*note 调用guix refresh::). 取决于受影响的软件包的数量,即需要重新构建的数量,commit需要被提交 到不同的分支,具体如下: 300个或更少的受影响的软件包 ‘master’分支(非破坏性的更改)。 300 至 1800 个受影响的软件包 ‘staging’ branch (non-disruptive changes). This branch is intended to be merged in ‘master’ every 6 weeks or so. Topical changes (e.g., an update of the GNOME stack) can instead go to a specific branch (say, ‘gnome-updates’). This branch is not expected to be buildable or usable until late in its development process. 超过 1800 个受影响的软件包 ‘core-updates’ branch (may include major and potentially disruptive changes). This branch is intended to be merged in ‘master’ every 6 months or so. This branch is not expected to be buildable or usable until late in its development process. All these branches are tracked by our build farm (https://ci.guix.gnu.org) and merged into ‘master’ once everything has been successfully built. This allows us to fix issues before they hit users, and to reduce the window during which pre-built binaries are not available. When we decide to start building the ‘staging’ or ‘core-updates’ branches, they will be forked and renamed with the suffix ‘-frozen’, at which time only bug fixes may be pushed to the frozen branches. The ‘core-updates’ and ‘staging’ branches will remain open to accept patches for the next cycle. Please ask on the mailing list or IRC if unsure where to place a patch. 10. 检查软件包的构建过程是不是确定性的。这通常意味着检查对软件包的独立 构建是否能得到每一个比特都完全相同的结果。 为此,一个简单的做法是在你的机器上多次构建同一个软件包(*note 调用guix build::): guix build --rounds=2 <我的软件包> 这足以查出一批普通的不确定性问题,如构建结果里存在时间戳或随机生成 的输出。 Another option is to use ‘guix challenge’ (*note 调用guix challenge::). You may run it once the package has been committed and built by ‘ci.guix.gnu.org’ to check whether it obtains the same result as you did. Better yet: Find another machine that can build it and run ‘guix publish’. Since the remote build machine is likely different from yours, this can catch non-determinism issues related to the hardware—e.g., use of different instruction set extensions—or to the operating system kernel—e.g., reliance on ‘uname’ or ‘/proc’ files. 11. 在编写文档时,请用性别中立的词语指代人,如“他”, “他的” (https://en.wikipedia.org/wiki/Singular_they),等。 12. 检查你的补丁只包含一些相关的更改。把不相关的更改捆绑在一起会让评审 更困难和更慢。 不相关的更改的例子有:同时新增多个软件包,或更新软件包同时修补这个 软件包。 13. Please follow our code formatting rules, possibly running ‘guix style’ script to do that automatically for you (*note 格式化代码::). 14. 当可能时,请在源URL里使用镜像*note 调用guix download::。使用可靠的 而不是生成的URL。例如,GitHub的下载文件每次生成时不一定是相同的,所 以这时最好克隆仓库。不要在URL里使用‘name’变量:这没有什么用,而且如 果名字变了,URL很可能就错了。 15. Check if Guix builds (*note 从Git构建::) and address the warnings, especially those about use of undefined symbols. 16. Make sure your changes do not break Guix and simulate a ‘guix pull’ with: guix pull --url=/path/to/your/checkout --profile=/tmp/guix.master When posting a patch to the mailing list, use ‘[PATCH] ...’ as a subject, if your patch is to be applied on a branch other than ‘master’, say ‘core-updates’, specify it in the subject like ‘[PATCH core-updates] ...’. You may use your email client or the ‘git send-email’ command (*note 发送补丁系列::). We prefer to get patches in plain text messages, either inline or as MIME attachments. You are advised to pay attention if your email client changes anything like line breaks or indentation which could potentially break the patches. Expect some delay when you submit your very first patch to . You have to wait until you get an acknowledgement with the assigned tracking number. Future acknowledgements should not be delayed. When a bug is resolved, please close the thread by sending an email to . * Menu: * 配置Git:: * 发送补丁系列:: * Teams::  File: guix.zh_CN.info, Node: 配置Git, Next: 发送补丁系列, Up: 提交补丁 22.6.1 配置Git -------------- If you have not done so already, you may wish to set a name and email that will be associated with your commits (*note Telling Git your name: (git)telling git your name.). If you wish to use a different name or email just for commits in this repository, you can use ‘git config --local’, or edit ‘.git/config’ in the repository instead of ‘~/.gitconfig’. We provide some default settings in ‘etc/git/gitconfig’ which modify how patches are generated, making them easier to read and apply. These settings can be applied by manually copying them to ‘.git/config’ in your checkout, or by telling Git to include the whole file: git config --local include.path ../etc/git/gitconfig From then on, any changes to ‘etc/git/gitconfig’ would automatically take effect. Since the first patch in a series must be sent separately (*note 发送补丁系列::), it can also be helpful to tell ‘git format-patch’ to handle the e-mail threading instead of ‘git send-email’: git config --local format.thread shallow git config --local sendemail.thread no  File: guix.zh_CN.info, Node: 发送补丁系列, Next: Teams, Prev: 配置Git, Up: 提交补丁 22.6.2 发送补丁系列 ------------------- Single Patches .............. The ‘git send-email’ command is the best way to send both single patches and patch series (*note Multiple Patches::) to the Guix mailing list. Sending patches as email attachments may make them difficult to review in some mail clients, and ‘git diff’ does not store commit metadata. 注: The ‘git send-email’ command is provided by the ‘send-email’ output of the ‘git’ package, i.e. ‘git:send-email’. The following command will create a patch email from the latest commit, open it in your EDITOR or VISUAL for editing, and send it to the Guix mailing list to be reviewed and merged: $ git send-email -1 -a --base=auto --to=guix-patches@gnu.org Tip: To add a prefix to the subject of your patch, you may use the ‘--subject-prefix’ option. The Guix project uses this to specify that the patch is intended for a branch or repository other than the ‘master’ branch of . git send-email -1 -a --base=auto \ --subject-prefix='PATCH core-updates' \ --to=guix-patches@gnu.org The patch email contains a three-dash separator line after the commit message. You may “annotate” the patch with explanatory text by adding it under this line. If you do not wish to annotate the email, you may drop the ‘-a’ flag (which is short for ‘--annotate’). The ‘--base=auto’ flag automatically adds a note at the bottom of the patch of the commit it was based on, making it easier for maintainers to rebase and merge your patch. If you need to send a revised patch, don’t resend it like this or send a “fix” patch to be applied on top of the last one; instead, use ‘git commit -a’ or ‘git rebase’ (https://git-rebase.io) to modify the commit, and use the address and the ‘-v’ flag with ‘git send-email’. $ git commit -a $ git send-email -1 -a --base=auto -v REVISION \ --to=ISSUE_NUMBER@debbugs.gnu.org You can find out ISSUE_NUMBER either by searching on the mumi interface at for the name of your patch or reading the acknowledgement email sent automatically by Debbugs in reply to incoming bugs and patches, which contains the bug number. Notifying Teams ............... The ‘etc/teams.scm’ script may be used to notify all those who may be interested in your patch of its existence (*note Teams::). Use ‘etc/teams.scm list-teams’ to display all the teams, decide which team(s) your patch relates to, and use ‘etc/teams.scm cc’ to output various ‘git send-email’ flags which will notify the appropriate team members, or use ‘etc/teams.scm cc-members’ to detect the appropriate teams automatically. Multiple Patches ................ While ‘git send-email’ alone will suffice for a single patch, an unfortunate flaw in Debbugs means you need to be more careful when sending multiple patches: if you send them all to the address, a new issue will be created for each patch! When sending a series of patches, it’s best to send a Git “cover letter” first, to give reviewers an overview of the patch series. We can create a directory called ‘outgoing’ containing both our patch series and a cover letter called ‘0000-cover-letter.patch’ with ‘git format-patch’. $ git format-patch -NUMBER_COMMITS -o outgoing \ --cover-letter --base=auto We can now send _just_ the cover letter to the address, which will create an issue that we can send the rest of the patches to. $ git send-email outgoing/0000-cover-letter.patch -a \ --to=guix-patches@debbugs.gnu.org \ $(etc/teams.scm cc-members ...) $ rm outgoing/0000-cover-letter.patch # we don't want to resend it! Ensure you edit the email to add an appropriate subject line and blurb before sending it. Note the automatically generated shortlog and diffstat below the blurb. Once the Debbugs mailer has replied to your cover letter email, you can send the actual patches to the newly-created issue address. $ git send-email outgoing/*.patch \ --to=ISSUE_NUMBER@debbugs.gnu.org \ $(etc/teams.scm cc-members ...) $ rm -rf outgoing # we don't need these anymore Thankfully, this ‘git format-patch’ dance is not necessary to send an amended patch series, since an issue already exists for the patchset. $ git send-email -NUMBER_COMMITS \ -vREVISION --base=auto \ --to ISSUE_NUMBER@debbugs.gnu.org If need be, you may use ‘--cover-letter -a’ to send another cover letter, e.g. for explaining what’s changed since the last revision, and these changes are necessary.  File: guix.zh_CN.info, Node: Teams, Prev: 发送补丁系列, Up: 提交补丁 22.6.3 Teams ------------ There are several teams mentoring different parts of the Guix source code. To list all those teams, you can run from a Guix checkout: $ ./etc/teams.scm list-teams id: mentors name: Mentors description: A group of mentors who chaperone contributions by newcomers. members: + Christopher Baines + Ricardo Wurmus + Mathieu Othacehe + jgart + Ludovic Courtès ... You can run the following command to have the ‘Mentors’ team put in CC of a patch series: $ git send-email --to ISSUE_NUMBER@debbugs.gnu.org $(./etc/teams.scm cc mentors) *.patch The appropriate team or teams can also be inferred from the modified files. For instance, if you want to send the two latest commits of the current Git repository to review, you can run: $ guix shell -D guix [env]$ git send-email --to ISSUE_NUMBER@debbugs.gnu.org $(./etc/teams.scm cc-members HEAD~2 HEAD) *.patch  File: guix.zh_CN.info, Node: 跟踪程序漏洞和补丁, Next: 提交权利, Prev: 提交补丁, Up: 贡献 22.7 跟踪程序漏洞和补丁 ======================= This section describes how the Guix project tracks its bug reports and patch submissions. * Menu: * The Issue Tracker:: The official bug and patch tracker. * Debbugs User Interfaces:: Ways to interact with Debbugs. * Debbugs Usertags:: Tag reports with custom labels.  File: guix.zh_CN.info, Node: The Issue Tracker, Next: Debbugs User Interfaces, Up: 跟踪程序漏洞和补丁 22.7.1 The Issue Tracker ------------------------ Bug reports and patch submissions are currently tracked using the Debbugs instance at . Bug reports are filed against the ‘guix’ “package” (in Debbugs parlance), by sending email to , while patch submissions are filed against the ‘guix-patches’ package by sending email to (*note 提交补丁::).  File: guix.zh_CN.info, Node: Debbugs User Interfaces, Next: Debbugs Usertags, Prev: The Issue Tracker, Up: 跟踪程序漏洞和补丁 22.7.2 Debbugs User Interfaces ------------------------------ A web interface (actually _two_ web interfaces!) are available to browse issues: • provides a pleasant interface(1) to browse bug reports and patches, and to participate in discussions; • lists bug reports; • lists patch submissions. To view discussions related to issue number N, go to ‘https://issues.guix.gnu.org/N’ or ‘https://bugs.gnu.org/N’. If you use Emacs, you may find it more convenient to interact with issues using ‘debbugs.el’, which you can install with: guix install emacs-debbugs For example, to list all open issues on ‘guix-patches’, hit: C-u M-x debbugs-gnu RET RET guix-patches RET n y *Note (debbugs-ug)Top::,了解更多有关此实用工具的信息! ---------- Footnotes ---------- (1) The web interface at is powered by Mumi, a nice piece of software written in Guile, and you can help! See .  File: guix.zh_CN.info, Node: Debbugs Usertags, Prev: Debbugs User Interfaces, Up: 跟踪程序漏洞和补丁 22.7.3 Debbugs Usertags ----------------------- Debbugs provides a feature called “usertags” that allows any user to tag any bug with an arbitrary label. Bugs can be searched by usertag, so this is a handy way to organize bugs(1). For example, to view all the bug reports (or patches, in the case of ‘guix-patches’) tagged with the usertag ‘powerpc64le-linux’ for the user ‘guix’, open a URL like the following in a web browser: . For more information on how to use usertags, please refer to the documentation for Debbugs or the documentation for whatever tool you use to interact with Debbugs. In Guix, we are experimenting with usertags to keep track of architecture-specific issues. To facilitate collaboration, all our usertags are associated with the single user ‘guix’. The following usertags currently exist for that user: ‘powerpc64le-linux’ The purpose of this usertag is to make it easy to find the issues that matter most for the ‘powerpc64le-linux’ system type. Please assign this usertag to bugs or patches that affect ‘powerpc64le-linux’ but not other system types. In addition, you may use it to identify issues that for some reason are particularly important for the ‘powerpc64le-linux’ system type, even if the issue affects other system types, too. ‘reproducibility’ For issues related to reproducibility. For example, it would be appropriate to assign this usertag to a bug report for a package that fails to build reproducibly. If you’re a committer and you want to add a usertag, just start using it with the ‘guix’ user. If the usertag proves useful to you, consider updating this section of the manual so that others will know what your usertag means. ---------- Footnotes ---------- (1) The list of usertags is public information, and anyone can modify any user’s list of usertags, so keep that in mind if you choose to use this feature.  File: guix.zh_CN.info, Node: 提交权利, Next: 更新Guix软件包, Prev: 跟踪程序漏洞和补丁, Up: 贡献 22.8 提交权利 ============= Everyone can contribute to Guix without having commit access (*note 提交补丁::). However, for frequent contributors, having write access to the repository can be convenient. As a rule of thumb, a contributor should have accumulated fifty (50) reviewed commits to be considered as a committer and have sustained their activity in the project for at least 6 months. This ensures enough interactions with the contributor, which is essential for mentoring and assessing whether they are ready to become a committer. Commit access should not be thought of as a “badge of honor” but rather as a responsibility a contributor is willing to take to help the project. The following sections explain how to get commit access, how to be ready to push commits, and the policies and community expectations for commits pushed upstream. 22.8.1 Applying for Commit Access --------------------------------- When you deem it necessary, consider applying for commit access by following these steps: 1. Find three committers who would vouch for you. You can view the list of committers at . Each of them should email a statement to (a private alias for the collective of maintainers), signed with their OpenPGP key. Committers are expected to have had some interactions with you as a contributor and to be able to judge whether you are sufficiently familiar with the project’s practices. It is _not_ a judgment on the value of your work, so a refusal should rather be interpreted as “let’s try again later”. 2. Send a message stating your intent, listing the three committers who support your application, signed with the OpenPGP key you will use to sign commits, and giving its fingerprint (see below). See , for an introduction to public-key cryptography with GnuPG. Set up GnuPG such that it never uses the SHA1 hash algorithm for digital signatures, which is known to be unsafe since 2019, for instance by adding the following line to ‘~/.gnupg/gpg.conf’ (*note (gnupg)GPG Esoteric Options::): digest-algo sha512 3. Maintainers ultimately decide whether to grant you commit access, usually following your referrals’ recommendation. 4. If and once you’ve been given access, please send a message to to say so, again signed with the OpenPGP key you will use to sign commits (do that before pushing your first commit). That way, everyone can notice and ensure you control that OpenPGP key. Important: Before you can push for the first time, maintainers must: 1. add your OpenPGP key to the ‘keyring’ branch; 2. add your OpenPGP fingerprint to the ‘.guix-authorizations’ file of the branch(es) you will commit to. 5. Make sure to read the rest of this section and... profit! 注: Maintainers are happy to give commit access to people who have been contributing for some time and have a track record—don’t be shy and don’t underestimate your work! However, note that the project is working towards a more automated patch review and merging system, which, as a consequence, may lead us to have fewer people with commit access to the main repository. Stay tuned! All commits that are pushed to the central repository on Savannah must be signed with an OpenPGP key, and the public key should be uploaded to your user account on Savannah and to public key servers, such as ‘keys.openpgp.org’. To configure Git to automatically sign commits, run: git config commit.gpgsign true # Substitute the fingerprint of your public PGP key. git config user.signingkey CABBA6EA1DC0FF33 To check that commits are signed with correct key, use: make authenticate You can prevent yourself from accidentally pushing unsigned or signed with the wrong key commits to Savannah by using the pre-push Git hook located at ‘etc/git/pre-push’: cp etc/git/pre-push .git/hooks/pre-push It additionally calls ‘make check-channel-news’ to be sure ‘news.scm’ file is correct. 22.8.2 Commit Policy -------------------- If you get commit access, please make sure to follow the policy below (discussions of the policy can take place on ). Non-trivial patches should always be posted to (trivial patches include fixing typos, etc.). This mailing list fills the patch-tracking database (*note 跟踪程序漏洞和补丁::). For patches that just add a new package, and a simple one, it’s OK to commit, if you’re confident (which means you successfully built it in a chroot setup, and have done a reasonable copyright and license auditing). Likewise for package upgrades, except upgrades that trigger a lot of rebuilds (for example, upgrading GnuTLS or GLib). We have a mailing list for commit notifications (), so people can notice. Before pushing your changes, make sure to run ‘git pull --rebase’. When pushing a commit on behalf of somebody else, please add a ‘Signed-off-by’ line at the end of the commit log message—e.g., with ‘git am --signoff’. This improves tracking of who did what. When adding channel news entries (*note Writing Channel News: 通道.), make sure they are well-formed by running the following command right before pushing: make check-channel-news For anything else, please post to and leave time for a review, without committing anything (*note 提交补丁::). If you didn’t receive any reply after two weeks, and if you’re confident, it’s OK to commit. That last part is subject to being adjusted, allowing individuals to commit directly on non-controversial changes on parts they’re familiar with. 22.8.3 Addressing Issues ------------------------ Peer review (*note 提交补丁::) and tools such as ‘guix lint’ (*note 调用guix lint::) and the test suite (*note 运行测试套件::) should catch issues before they are pushed. Yet, commits that “break” functionality might occasionally go through. When that happens, there are two priorities: mitigating the impact, and understanding what happened to reduce the chance of similar incidents in the future. The responsibility for both these things primarily lies with those involved, but like everything this is a group effort. Some issues can directly affect all users—for instance because they make ‘guix pull’ fail or break core functionality, because they break major packages (at build time or run time), or because they introduce known security vulnerabilities. The people involved in authoring, reviewing, and pushing such commit(s) should be at the forefront to mitigate their impact in a timely fashion: by pushing a followup commit to fix it (if possible), or by reverting it to leave time to come up with a proper fix, and by communicating with other developers about the problem. If these persons are unavailable to address the issue in time, other committers are entitled to revert the commit(s), explaining in the commit log and on the mailing list what the problem was, with the goal of leaving time to the original committer, reviewer(s), and author(s) to propose a way forward. Once the problem has been dealt with, it is the responsibility of those involved to make sure the situation is understood. If you are working to understand what happened, focus on gathering information and avoid assigning any blame. Do ask those involved to describe what happened, do not ask them to explain the situation—this would implicitly blame them, which is unhelpful. Accountability comes from a consensus about the problem, learning from it and improving processes so that it’s less likely to reoccur. 22.8.4 Commit Revocation ------------------------ In order to reduce the possibility of mistakes, committers will have their Savannah account removed from the Guix Savannah project and their key removed from ‘.guix-authorizations’ after 12 months of inactivity; they can ask to regain commit access by emailing the maintainers, without going through the vouching process. Maintainers(1) may also revoke an individual’s commit rights, as a last resort, if cooperation with the rest of the community has caused too much friction—even within the bounds of the project’s code of conduct (*note 贡献::). They would only do so after public or private discussion with the individual and a clear notice. Examples of behavior that hinders cooperation and could lead to such a decision include: • repeated violation of the commit policy stated above; • repeated failure to take peer criticism into account; • breaching trust through a series of grave incidents. When maintainers resort to such a decision, they notify developers on ; inquiries may be sent to . Depending on the situation, the individual may still be welcome to contribute. 22.8.5 Helping Out ------------------ One last thing: the project keeps moving forward because committers not only push their own awesome changes, but also offer some of their time _reviewing_ and pushing other people’s changes. As a committer, you’re welcome to use your expertise and commit rights to help other contributors, too! ---------- Footnotes ---------- (1) See for the current list of maintainers. You can email them privately at .  File: guix.zh_CN.info, Node: 更新Guix软件包, Next: 撰写文档, Prev: 提交权利, Up: 贡献 22.9 更新Guix软件包 =================== It is sometimes desirable to update the ‘guix’ package itself (the package defined in ‘(gnu packages package-management)’), for example to make new daemon features available for use by the ‘guix-service-type’ service type. In order to simplify this task, the following command can be used: make update-guix-package The ‘update-guix-package’ make target will use the last known _commit_ corresponding to ‘HEAD’ in your Guix checkout, compute the hash of the Guix sources corresponding to that commit and update the ‘commit’, ‘revision’ and hash of the ‘guix’ package definition. To validate that the updated ‘guix’ package hashes are correct and that it can be built successfully, the following command can be run from the directory of your Guix checkout: ./pre-inst-env guix build guix To guard against accidentally updating the ‘guix’ package to a commit that others can’t refer to, a check is made that the commit used has already been pushed to the Savannah-hosted Guix git repository. This check can be disabled, _at your own peril_, by setting the ‘GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT’ environment variable. When this variable is set, the updated package source is also added to the store. This is used as part of the release process of Guix.  File: guix.zh_CN.info, Node: 撰写文档, Next: 翻译 Guix, Prev: 更新Guix软件包, Up: 贡献 22.10 撰写文档 ============== Guix is documented using the Texinfo system. If you are not yet familiar with it, we accept contributions for documentation in most formats. That includes plain text, Markdown, Org, etc. Documentation contributions can be sent to . Prepend ‘[DOCUMENTATION]’ to the subject. When you need to make more than a simple addition to the documentation, we prefer that you send a proper patch as opposed to sending an email as described above. *Note 提交补丁:: for more information on how to send your patches. To modify the documentation, you need to edit ‘doc/guix.texi’ and ‘doc/contributing.texi’ (which contains this documentation section), or ‘doc/guix-cookbook.texi’ for the cookbook. If you compiled the Guix repository before, you will have many more ‘.texi’ files that are translations of these documents. Do not modify them, the translation is managed through Weblate (https://translate.fedoraproject.org/projects/guix). *Note 翻译 Guix:: for more information. To render documentation, you must first make sure that you ran ‘./configure’ in your source tree (*note 在安装之前运行Guix::). After that you can run one of the following commands: • ‘make doc/guix.info’ to compile the Info manual. You can check it with ‘info doc/guix.info’. • ‘make doc/guix.html’ to compile the HTML version. You can point your browser to the relevant file in the ‘doc/guix.html’ directory. • ‘make doc/guix-cookbook.info’ for the cookbook Info manual. • ‘make doc/guix-cookbook.html’ for the cookbook HTML version.  File: guix.zh_CN.info, Node: 翻译 Guix, Prev: 撰写文档, Up: 贡献 22.11 翻译 Guix =============== Writing code and packages is not the only way to provide a meaningful contribution to Guix. Translating to a language you speak is another example of a valuable contribution you can make. This section is designed to describe the translation process. It gives you advice on how you can get involved, what can be translated, what mistakes you should avoid and what we can do to help you! Guix is a big project that has multiple components that can be translated. We coordinate the translation effort on a Weblate instance (https://translate.fedoraproject.org/projects/guix/) hosted by our friends at Fedora. You will need an account to submit translations. Some of the software packaged in Guix also contain translations. We do not host a translation platform for them. If you want to translate a package provided by Guix, you should contact their developers or find the information on their website. As an example, you can find the homepage of the ‘hello’ package by typing ‘guix show hello’. On the “homepage” line, you will see as the homepage. Many GNU and non-GNU packages can be translated on the Translation Project (https://translationproject.org). Some projects with multiple components have their own platform. For instance, GNOME has its own platform, Damned Lies (https://l10n.gnome.org/). Guix has five components hosted on Weblate. • ‘guix’ contains all the strings from the Guix software (the guided system installer, the package manager, etc), excluding packages. • ‘packages’ contains the synopsis (single-sentence description of a package) and description (longer description) of packages in Guix. • ‘website’ contains the official Guix website, except for blog posts and multimedia content. • ‘documentation-manual’ corresponds to this manual. • ‘documentation-cookbook’ is the component for the cookbook. General Directions .................. Once you get an account, you should be able to select a component from the guix project (https://translate.fedoraproject.org/projects/guix/), and select a language. If your language does not appear in the list, go to the bottom and click on the “Start new translation” button. Select the language you want to translate to from the list, to start your new translation. Like lots of other free software packages, Guix uses GNU Gettext (https://www.gnu.org/software/gettext) for its translations, with which translatable strings are extracted from the source code to so-called PO files. Even though PO files are text files, changes should not be made with a text editor but with PO editing software. Weblate integrates PO editing functionality. Alternatively, translators can use any of various free-software tools for filling in translations, of which Poedit (https://poedit.net/) is one example, and (after logging in) upload (https://docs.weblate.org/en/latest/user/files.html) the changed file. There is also a special PO editing mode (https://www.emacswiki.org/emacs/PoMode) for users of GNU Emacs. Over time translators find out what software they are happy with and what features they need. On Weblate, you will find various links to the editor, that will show various subsets (or all) of the strings. Have a look around and at the documentation (https://docs.weblate.org/en/latest/) to familiarize yourself with the platform. Translation Components ...................... In this section, we provide more detailed guidance on the translation process, as well as details on what you should or should not do. When in doubt, please contact us, we will be happy to help! guix Guix is written in the Guile programming language, and some strings contain special formatting that is interpreted by Guile. These special formatting should be highlighted by Weblate. They start with ‘~’ followed by one or more characters. When printing the string, Guile replaces the special formatting symbols with actual values. For instance, the string ‘ambiguous package specification `~a'’ would be substituted to contain said package specification instead of ‘~a’. To properly translate this string, you must keep the formatting code in your translation, although you can place it where it makes sense in your language. For instance, the French translation says ‘spécification du paquet « ~a » ambiguë’ because the adjective needs to be placed in the end of the sentence. If there are multiple formatting symbols, make sure to respect the order. Guile does not know in which order you intended the string to be read, so it will substitute the symbols in the same order as the English sentence. As an example, you cannot translate ‘package '~a' has been superseded by '~a'’ by ‘'~a' superseeds package '~a'’, because the meaning would be reversed. If FOO is superseded by BAR, the translation would read ‘'foo' superseeds package 'bar'’. To work around this problem, it is possible to use more advanced formatting to select a given piece of data, instead of following the default English order. *Note (guile)Formatted Output::, for more information on formatting in Guile. packages Package descriptions occasionally contain Texinfo markup (*note 简介和描述::). Texinfo markup looks like ‘@code{rm -rf}’, ‘@emph{important}’, etc. When translating, please leave markup as is. The characters after “@” form the name of the markup, and the text between “{” and “}” is its content. In general, you should not translate the content of markup like ‘@code’, as it contains literal code that do not change with language. You can translate the content of formatting markup such as ‘@emph’, ‘@i’, ‘@itemize’, ‘@item’. However, do not translate the name of the markup, or it will not be recognized. Do not translate the word after ‘@end’, it is the name of the markup that is closed at this position (e.g. ‘@itemize ... @end itemize’). documentation-manual and documentation-cookbook The first step to ensure a successful translation of the manual is to find and translate the following strings _first_: • ‘version.texi’: Translate this string as ‘version-xx.texi’, where ‘xx’ is your language code (the one shown in the URL on weblate). • ‘contributing.texi’: Translate this string as ‘contributing.xx.texi’, where ‘xx’ is the same language code. • ‘Top’: Do not translate this string, it is important for Texinfo. If you translate it, the document will be empty (missing a Top node). Please look for it, and register ‘Top’ as its translation. Translating these strings first ensure we can include your translation in the guix repository without breaking the make process or the ‘guix pull’ machinery. The manual and the cookbook both use Texinfo. As for ‘packages’, please keep Texinfo markup as is. There are more possible markup types in the manual than in the package descriptions. In general, do not translate the content of ‘@code’, ‘@file’, ‘@var’, ‘@value’, etc. You should translate the content of formatting markup such as ‘@emph’, ‘@i’, etc. The manual contains sections that can be referred to by name by ‘@ref’, ‘@xref’ and ‘@pxref’. We have a mechanism in place so you do not have to translate their content. If you keep the English title, we will automatically replace it with your translation of that title. This ensures that Texinfo will always be able to find the node. If you decide to change the translation of the title, the references will automatically be updated and you will not have to update them all yourself. When translating references from the cookbook to the manual, you need to replace the name of the manual and the name of the section. For instance, to translate ‘@pxref{Defining Packages,,, guix, GNU Guix Reference Manual}’, you would replace ‘Defining Packages’ with the title of that section in the translated manual _only_ if that title is translated. If the title is not translated in your language yet, do not translate it here, or the link will be broken. Replace ‘guix’ with ‘guix.xx’ where ‘xx’ is your language code. ‘GNU Guix Reference Manual’ is the text of the link. You can translate it however you wish. website The website pages are written using SXML, an s-expression version of HTML, the basic language of the web. We have a process to extract translatable strings from the source, and replace complex s-expressions with a more familiar XML markup, where each markup is numbered. Translators can arbitrarily change the ordering, as in the following example. #. TRANSLATORS: Defining Packages is a section name #. in the English (en) manual. #: apps/base/templates/about.scm:64 msgid "Packages are <1>defined<1.1>en<1.2>Defining-Packages.html as native <2>Guile modules." msgstr "Pakete werden als reine <2>Guile-Module <1>definiert<1.1>de<1.2>Pakete-definieren.html." Note that you need to include the same markups. You cannot skip any. In case you make a mistake, the component might fail to build properly with your language, or even make guix pull fail. To prevent that, we have a process in place to check the content of the files before pushing to our repository. We will not be able to update the translation for your language in Guix, so we will notify you (through weblate and/or by email) so you get a chance to fix the issue. Outside of Weblate .................. Currently, some parts of Guix cannot be translated on Weblate, help wanted! • ‘guix pull’ news can be translated in ‘news.scm’, but is not available from Weblate. If you want to provide a translation, you can prepare a patch as described above, or simply send us your translation with the name of the news entry you translated and your language. *Note Writing Channel News::, for more information about channel news. • Guix blog posts cannot currently be translated. • The installer script (for foreign distributions) is entirely in English. • Some of the libraries Guix uses cannot be translated or are translated outside of the Guix project. Guile itself is not internationalized. • Other manuals linked from this manual or the cookbook might not be translated. Conditions for Inclusion ........................ There are no conditions for adding new translations of the ‘guix’ and ‘guix-packages’ components, other than they need at least one translated string. New languages will be added to Guix as soon as possible. The files may be removed if they fall out of sync and have no more translated strings. Given that the web site is dedicated to new users, we want its translation to be as complete as possible before we include it in the language menu. For a new language to be included, it needs to reach at least 80% completion. When a language is included, it may be removed in the future if it stays out of sync and falls below 60% completion. The manual and cookbook are automatically added in the default compilation target. Every time we synchronize translations, developers need to recompile all the translated manuals and cookbooks. This is useless for what is essentially the English manual or cookbook. Therefore, we will only include a new language when it reaches 10% completion in the component. When a language is included, it may be removed in the future if it stays out of sync and falls below 5% completion. Translation Infrastructure .......................... Weblate is backed by a git repository from which it discovers new strings to translate and pushes new and updated translations. Normally, it would be enough to give it commit access to our repositories. However, we decided to use a separate repository for two reasons. First, we would have to give Weblate commit access and authorize its signing key, but we do not trust it in the same way we trust guix developers, especially since we do not manage the instance ourselves. Second, if translators mess something up, it can break the generation of the website and/or guix pull for all our users, independently of their language. For these reasons, we use a dedicated repository to host translations, and we synchronize it with our guix and artworks repositories after checking no issue was introduced in the translation. Developers can download the latest PO files from weblate in the Guix repository by running the ‘make download-po’ command. It will automatically download the latest files from weblate, reformat them to a canonical form, and check they do not contain issues. The manual needs to be built again to check for additional issues that might crash Texinfo. Before pushing new translation files, developers should add them to the make machinery so the translations are actually available. The process differs for the various components. • New po files for the ‘guix’ and ‘packages’ components must be registered by adding the new language to ‘po/guix/LINGUAS’ or ‘po/packages/LINGUAS’. • New po files for the ‘documentation-manual’ component must be registered by adding the file name to ‘DOC_PO_FILES’ in ‘po/doc/local.mk’, the generated ‘%D%/guix.xx.texi’ manual to ‘info_TEXINFOS’ in ‘doc/local.mk’ and the generated ‘%D%/guix.xx.texi’ and ‘%D%/contributing.xx.texi’ to ‘TRANSLATED_INFO’ also in ‘doc/local.mk’. • New po files for the ‘documentation-cookbook’ component must be registered by adding the file name to ‘DOC_COOKBOOK_PO_FILES’ in ‘po/doc/local.mk’, the generated ‘%D%/guix-cookbook.xx.texi’ manual to ‘info_TEXINFOS’ in ‘doc/local.mk’ and the generated ‘%D%/guix-cookbook.xx.texi’ to ‘TRANSLATED_INFO’ also in ‘doc/local.mk’. • New po files for the ‘website’ component must be added to the ‘guix-artwork’ repository, in ‘website/po/’. ‘website/po/LINGUAS’ and ‘website/po/ietf-tags.scm’ must be updated accordingly (see ‘website/i18n-howto.txt’ for more information on the process).  File: guix.zh_CN.info, Node: 致谢, Next: GNU自由文档许可证, Prev: 贡献, Up: Top 23 致谢 ******* Guix is based on the Nix package manager (https://nixos.org/nix/), which was designed and implemented by Eelco Dolstra, with contributions from other people (see the ‘nix/AUTHORS’ file in Guix). Nix pioneered functional package management, and promoted unprecedented features, such as transactional package upgrades and rollbacks, per-user profiles, and referentially transparent build processes. Without this work, Guix would not exist. 基于 Nix 的软件发行版 Nixpkgs 和 NixOS 也给 Guix 带来了灵感。 GNU Guix itself is a collective work with contributions from a number of people. See the ‘AUTHORS’ file in Guix for more information on these fine people. The ‘THANKS’ file lists people who have helped by reporting bugs, taking care of the infrastructure, providing artwork and themes, making suggestions, and more—thank you!  File: guix.zh_CN.info, Node: GNU自由文档许可证, Next: 概念索引, Prev: 致谢, Up: Top Appendix A GNU自由文档许可证 **************************** Version 1.3, 3 November 2008 Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document “free” in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”. Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text. The “publisher” means any person or entity that distributes copies of the Document to the public. A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles. You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.” 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See . Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Document. 11. RELICENSING “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A “Massive Multiauthor Collaboration” (or “MMC”) contained in the site means any set of copyrightable works thus published on the MMC site. “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. “Incorporate” means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is “eligible for relicensing” if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing. ADDENDUM: How to use this License for your documents ==================================================== To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (C) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.  File: guix.zh_CN.info, Node: 概念索引, Next: 编程索引, Prev: GNU自由文档许可证, Up: Top 概念索引 ******** [index] * Menu: * .local, host name lookup: Name Service Switch. (line 21) * /bin/sh: 基础服务. (line 34) * /usr/bin/env: 基础服务. (line 37) * AArch64, bootloaders: 引导设置. (line 26) * access control list (ACL), for substitutes: substitute服务器授权. (line 6) * accounts: 用户帐号. (line 6) * ACL (access control list), for substitutes: substitute服务器授权. (line 6) * actions, of Shepherd services: Shepherd服务. (line 60) * agate: Web服务. (line 1030) * aliases, for email addresses: 邮件服务. (line 1485) * aliases, for guix package: 调用guix package. (line 26) * ALSA: 声音服务. (line 6) * Android distribution: 构建系统. (line 161) * Android NDK build system: 构建系统. (line 161) * application bundle: 调用guix pack. (line 15) * archival of source code, Software Heritage: 调用guix lint. (line 49) * ARM, bootloaders: 引导设置. (line 26) * Audit: 其它各种服务. (line 291) * authentication, of a Guix checkout: 从Git构建. (line 10) * authentication, of channel code: 调用guix pull. (line 190) * authentication, of channel code <1>: Channel Authentication. (line 6) * authenticity, of code obtained with guix pull: 调用guix pull. (line 6) * authorized keys, SSH: 网络服务. (line 791) * authorizing, archives: 调用guix archive. (line 114) * AutoSSH: 网络服务. (line 873) * availability of substitutes: 调用guix weather. (line 13) * backquote (quasiquote): 定义软件包. (line 89) * bag (low-level package representation): 构建系统. (line 15) * bash: Shells Home Services. (line 6) * bash <1>: Invoking guix home. (line 21) * bill of materials (manifests): 书写清单. (line 6) * binfmt_misc: 虚拟化服务. (line 544) * Bioconductor: 调用guix import. (line 134) * BIOS boot, on Intel machines: 使用配置系统. (line 79) * BIOS, bootloader: 引导设置. (line 20) * black list, of kernel modules: 初始的内存虚拟硬盘. (line 112) * boot loader: 引导设置. (line 6) * boot menu: 引导设置. (line 190) * bootloader: 引导设置. (line 6) * bootstrap binaries: 引导. (line 20) * bootstrap binaries <1>: Preparing to Use the Bootstrap Binaries. (line 102) * bootstrapping: 引导. (line 6) * bug reports, tracking: The Issue Tracker. (line 6) * build code quoting: G-表达式. (line 6) * build failures, debugging: 调试构建错误. (line 6) * build farm: Official Substitute Servers. (line 6) * build logs, access: 额外的构建选项. (line 243) * build logs, publication: 调用guix publish. (line 67) * build logs, verbosity: 普通的构建选项. (line 98) * build phases: 构建系统. (line 41) * build phases <1>: 构建系统. (line 1058) * build phases <2>: Build Utilities. (line 275) * build phases, customizing: Build Phases. (line 151) * build phases, for packages: Build Phases. (line 6) * build phases, modifying: Build Utilities. (line 285) * build system: 构建系统. (line 6) * build-time dependencies: Derivations. (line 13) * bundle: 调用guix pack. (line 15) * cache invalidation, nscd: 基础服务. (line 365) * caching, in guix shell: Invoking guix shell. (line 361) * caching, of profiles: Invoking guix shell. (line 361) * CalDAV: 邮件服务. (line 1531) * CardDAV: 邮件服务. (line 1531) * Cargo (Rust build system): 构建系统. (line 224) * cat-avatar-generator: Web服务. (line 905) * CD image format: 调用guix system. (line 412) * certificates: 调用guix environment. (line 99) * Cgit service: 版本控制服务. (line 139) * challenge: 调用guix challenge. (line 6) * channel authorizations: Specifying Channel Authorizations. (line 6) * channel introduction: Specifying Channel Authorizations. (line 34) * channel news: 调用guix pull. (line 106) * channels: 通道. (line 6) * channels, for personal packages: 创建一个频道. (line 6) * channels.scm, configuration file: 调用guix pull. (line 95) * channels.scm, configuration file <1>: 通道. (line 6) * childhurd: 虚拟化服务. (line 648) * childhurd, offloading: 虚拟化服务. (line 769) * chroot: 设置构建环境. (line 40) * chroot <1>: 调用guix-daemon. (line 17) * chroot, guix system: System Troubleshooting Tips. (line 15) * chrooting, guix system: System Troubleshooting Tips. (line 15) * Clojure (programming language): 构建系统. (line 334) * closure: 调用guix gc. (line 127) * closure <1>: 调用guix size. (line 6) * closure <2>: 调用guix size. (line 28) * clusters, daemon setup: 调用guix-daemon. (line 236) * clusters, daemon setup <1>: 仓库. (line 47) * code staging: Build Phases. (line 186) * code staging <1>: G-表达式. (line 12) * colliding packages in profiles: 调用guix package. (line 354) * collisions, in a profile: 调用guix package. (line 354) * comma (unquote): 定义软件包. (line 89) * commit access, for developers: 提交权利. (line 6) * complex configurations: Complex Configurations. (line 6) * composition of Guix revisions: Inferiors. (line 9) * Compressed RAM-based block devices: Linux Services. (line 160) * compressed swap: Linux Services. (line 160) * configuration file for channels: 调用guix pull. (line 95) * configuration file for channels <1>: 通道. (line 6) * configuration file, of a shepherd service: 服务. (line 41) * configuration file, of Shepherd services: Shepherd服务. (line 151) * configuration of guix pull: 通道. (line 6) * configuration, action for shepherd services: 服务. (line 41) * Connman: Networking Setup. (line 257) * container, for guix home: Declaring the Home Environment. (line 71) * container, for guix home <1>: Invoking guix home. (line 53) * ContentDB: 调用guix import. (line 96) * continuous integration: 软件包转换选项. (line 218) * continuous integration <1>: 持续集成. (line 6) * continuous integration, statistics: 调用guix weather. (line 36) * copy, of store items, over SSH: 调用guix copy. (line 6) * corruption, recovering from: 调用guix gc. (line 169) * corruption, recovering from <1>: 额外的构建选项. (line 221) * cover letter: 发送补丁系列. (line 71) * CPAN: 调用guix import. (line 120) * CPU frequency scaling with thermald: 电源管理服务. (line 432) * CRAN: 调用guix import. (line 134) * crate: 调用guix import. (line 342) * Creating system images in various formats: 调用guix system. (line 270) * creating virtual machine images: 调用guix system. (line 299) * cron: 执行计划任务. (line 6) * cron <1>: Mcron Home Service. (line 6) * cross compilation: G-表达式. (line 75) * cross compilation, package dependencies: 软件包引用. (line 87) * cross-compilation: 调用guix pack. (line 267) * cross-compilation <1>: 定义软件包. (line 153) * cross-compilation <2>: 额外的构建选项. (line 195) * CTAN: 调用guix import. (line 181) * customization, of services: 使用配置系统. (line 143) * customizing packages: Defining Package Variants. (line 6) * CVE, Common Vulnerabilities and Exposures: 调用guix lint. (line 74) * daemon, cluster setup: 调用guix-daemon. (line 236) * daemon, cluster setup <1>: 仓库. (line 47) * daemon, remote access: 调用guix-daemon. (line 236) * daemon, remote access <1>: 仓库. (line 47) * daemons: 合成服务. (line 6) * DAG: 调用guix graph. (line 6) * darkstat: 监控服务. (line 102) * database: 数据库服务. (line 6) * ddclient: DNS服务. (line 639) * Debbugs usertags: Debbugs Usertags. (line 6) * Debbugs, issue tracking system: The Issue Tracker. (line 6) * Debbugs, Mumi Web interface: Web服务. (line 680) * debugging files: 安装调试文件. (line 6) * debugging info, rebuilding: 软件包转换选项. (line 146) * debugging info, rebuilding <1>: Rebuilding Debug Info. (line 6) * deleting home generations: Invoking guix home. (line 172) * deleting system generations: 调用guix system. (line 169) * dependencies, build-time: Derivations. (line 13) * dependencies, channels: Declaring Channel Dependencies. (line 6) * dependencies, run-time: Derivations. (line 38) * dependency graph rewriting: Defining Package Variants. (line 161) * derivation: 调用guix gc. (line 137) * derivation <1>: 编程接口. (line 19) * derivation path: Derivations. (line 24) * derivations: Derivations. (line 6) * determinism, checking: 额外的构建选项. (line 208) * development environments: Invoking guix shell. (line 6) * development inputs, of a package: 软件包引用. (line 211) * device mapping: 映射的设备. (line 6) * DHCP: 键盘布局、网络和分区. (line 75) * DHCP, networking service: Networking Setup. (line 173) * dhtproxy, for use with jami: 网络服务. (line 356) * dictionary: 其它各种服务. (line 142) * digital signatures: 验证substitute. (line 6) * disk encryption: 映射的设备. (line 67) * disk space: 调用guix gc. (line 6) * display manager, lightdm: X窗口. (line 288) * DNS (domain name system): DNS服务. (line 6) * Docker: 其它各种服务. (line 234) * Docker, build an image with guix pack: 调用guix pack. (line 54) * docker-image, creating docker images: 调用guix system. (line 308) * documentation: 有多个输出的软件包. (line 24) * documentation <1>: 更新Guix软件包. (line 33) * documentation, searching for: 文档. (line 6) * domain name system (DNS): DNS服务. (line 6) * downgrade attacks, protection against: 调用guix pull. (line 179) * downloading package sources: 调用guix download. (line 6) * dual boot: 引导设置. (line 190) * DVD image format: 调用guix system. (line 412) * early out of memory daemon: Linux Services. (line 6) * earlyoom: Linux Services. (line 6) * editing, service type definition: 调用guix system. (line 57) * editing, service type definition <1>: Invoking guix home. (line 90) * EFI boot: 使用配置系统. (line 79) * EFI, bootloader: 引导设置. (line 20) * EFI, installation: 键盘布局、网络和分区. (line 118) * egg: 调用guix import. (line 442) * elisp, packaging: Emacs Packages. (line 6) * elm: 调用guix import. (line 360) * Elm: Elm Packages. (line 6) * elpa: 调用guix import. (line 307) * emacs: 设置应用程序. (line 150) * emacs, packaging: Emacs Packages. (line 6) * email: 邮件服务. (line 6) * email aliases: 邮件服务. (line 1485) * emulation: 虚拟化服务. (line 544) * emulation <1>: 虚拟化服务. (line 609) * encrypted disk: 键盘布局、网络和分区. (line 152) * encrypted disk <1>: 使用配置系统. (line 183) * entry point, for Docker images: 调用guix pack. (line 217) * env, in /usr/bin: 基础服务. (line 37) * environment variables: Essential Home Services. (line 10) * environment, package build environment: Invoking guix shell. (line 6) * error strategy: 调用guix system. (line 459) * ESP, EFI system partition: 键盘布局、网络和分区. (line 118) * essential services: 操作系统参考. (line 166) * exporting files from the store: 调用guix archive. (line 6) * exporting store items: 调用guix archive. (line 14) * extending the package collection (channels): Specifying Additional Channels. (line 6) * extensions, for gexps: G-表达式. (line 132) * Fail2Ban: 其它各种服务. (line 424) * fastcgi: Web服务. (line 710) * fc-cache: 设置应用程序. (line 108) * fcgiwrap: Web服务. (line 710) * FHS (file system hierarchy standard): Invoking guix shell. (line 343) * file system hierarchy standard (FHS): Invoking guix shell. (line 343) * file, searching: Build Utilities. (line 151) * file-like objects: G-表达式. (line 294) * fingerprint: 其它各种服务. (line 6) * firmware: 操作系统参考. (line 73) * fixed-output derivations: Derivations. (line 31) * fixed-output derivations, for download: origin参考手册. (line 22) * font cache: 设置应用程序. (line 108) * foreign architectures: 交叉编译. (line 6) * format conventions: Invoking guix style. (line 6) * format, code style: Invoking guix style. (line 6) * G-expression: G-表达式. (line 6) * ganeti: 虚拟化服务. (line 799) * garbage collector: 调用guix gc. (line 6) * garbage collector root, for environments: Invoking guix shell. (line 374) * garbage collector root, for environments <1>: 调用guix environment. (line 121) * garbage collector root, for packs: 调用guix pack. (line 308) * garbage collector roots, adding: 额外的构建选项. (line 233) * GC roots, adding: 额外的构建选项. (line 233) * GCC: The GCC toolchain. (line 6) * GC根: 调用guix-daemon. (line 186) * GC根 <1>: 调用guix gc. (line 12) * GDM: X窗口. (line 11) * gem: 调用guix import. (line 72) * generations: 调用guix package. (line 275) * generations <1>: 调用guix package. (line 474) * generations <2>: 调用guix pull. (line 139) * generations <3>: 调用guix system. (line 122) * git configuration: 配置Git. (line 6) * git format-patch: 配置Git. (line 6) * git format-patch <1>: 发送补丁系列. (line 5) * git send-email: 配置Git. (line 6) * git send-email <1>: 发送补丁系列. (line 6) * Git, forge: 版本控制服务. (line 997) * Git, hosting: 版本控制服务. (line 874) * Git, using the latest commit: 软件包转换选项. (line 205) * Git, web interface: 版本控制服务. (line 139) * Gitile service: 版本控制服务. (line 997) * Gitolite service: 版本控制服务. (line 874) * global security system: 网络文件系统. (line 124) * gmnisrv: Web服务. (line 1003) * GNOME, login manager: X窗口. (line 11) * GNU Build System: 定义软件包. (line 75) * GNU Mailutils IMAP4 Daemon: 邮件服务. (line 1508) * go: 调用guix import. (line 417) * gpm: 基础服务. (line 702) * grafts: 安全更新. (line 30) * groups: 用户帐号. (line 44) * groups <1>: 用户帐号. (line 114) * GSS: 网络文件系统. (line 124) * GSSD: 网络文件系统. (line 124) * guix archive: 调用guix archive. (line 6) * guix build: 调用guix build. (line 6) * guix challenge: 调用guix challenge. (line 6) * guix container: 调用guix container. (line 6) * guix copy: 调用guix copy. (line 6) * guix deploy: 调用 guix deploy. (line 6) * guix describe: 调用guix describe. (line 6) * guix download: 调用guix download. (line 6) * guix edit: 调用guix edit。. (line 6) * guix environment: Invoking guix shell. (line 6) * guix environment <1>: 调用guix environment. (line 6) * guix gc: 调用guix gc. (line 6) * guix git authenticate: 调用guix git授权. (line 6) * guix graph: 调用guix graph. (line 6) * guix hash: 调用guix hash. (line 6) * guix home: Invoking guix home. (line 6) * guix lint: 调用guix lint. (line 6) * guix pack: 调用guix pack. (line 6) * guix package: 调用guix package. (line 6) * guix processes: 调用guix processes. (line 6) * guix publish: 调用guix publish. (line 6) * guix pull: 调用guix pull. (line 6) * guix pull for the root user, on a foreign distro: Upgrading Guix. (line 12) * guix pull, configuration file: 通道. (line 6) * guix refresh: 调用guix refresh. (line 6) * guix repl: 调用guix repl. (line 6) * guix shell: Invoking guix shell. (line 6) * guix size: 调用guix size. (line 6) * guix style: Invoking guix style. (line 6) * guix system: 调用guix system. (line 6) * guix system troubleshooting: 构建安装镜像. (line 29) * Guix System, installation: 系统安装. (line 6) * guix time-machine: Invoking guix time-machine. (line 6) * guix weather: 调用guix weather. (line 6) * guix-daemon: 调用guix-daemon. (line 6) * GuixSD,现在称为Guix系统: 介绍. (line 10) * Guix系统: 介绍. (line 10) * Guix系统 <1>: GNU发行版. (line 6) * Guix系统发行版,现在称为Guix系统: 介绍. (line 10) * hackage: 调用guix import. (line 237) * hardware support on Guix System: 硬件的考虑. (line 6) * HDPI: 引导设置. (line 278) * HDPI <1>: 调用guix system. (line 20) * hexpm: 调用guix import. (line 463) * hidden service: 网络服务. (line 462) * HiDPI: 引导设置. (line 278) * HiDPI <1>: 调用guix system. (line 20) * home configuration: Home Configuration. (line 6) * home generations: Invoking guix home. (line 146) * home services: Home Services. (line 6) * hostapd service, for Wi-Fi access points: 网络服务. (line 52) * hosts file: 操作系统参考. (line 85) * hpcguix-web: Web服务. (line 929) * HTTP: Web服务. (line 6) * HTTP proxy, for guix-daemon: 基础服务. (line 563) * HTTP, HTTPS: 证书服务. (line 6) * HTTPS, certificates: X.509证书. (line 6) * hurd: 操作系统参考. (line 17) * hurd <1>: 虚拟化服务. (line 648) * Hurd, offloading: 虚拟化服务. (line 769) * i18n: 撰写文档. (line 38) * idmapd: 网络文件系统. (line 145) * image, creating disk images: 调用guix system. (line 271) * IMAP: 邮件服务. (line 1237) * implicit inputs, of a package: 软件包引用. (line 211) * imported modules, for gexps: G-表达式. (line 95) * importing files to the store: 调用guix archive. (line 6) * importing packages: 调用guix import. (line 6) * incompatibility, of locale data: 区域. (line 76) * inetd: 网络服务. (line 273) * inferior packages: Inferiors. (line 14) * inferior packages <1>: Inferiors. (line 75) * inferiors: Inferiors. (line 9) * inferiors <1>: 调用guix repl. (line 42) * Info, documentation format: 文档. (line 6) * inherit, for package definitions: Defining Package Variants. (line 15) * init system: Shepherd服务. (line 6) * initial RAM disk: 操作系统参考. (line 63) * initial RAM disk <1>: 初始的内存虚拟硬盘. (line 6) * initial RAM disk <2>: 初始的内存虚拟硬盘. (line 127) * initrd: 操作系统参考. (line 63) * initrd <1>: 初始的内存虚拟硬盘. (line 6) * initrd <2>: 初始的内存虚拟硬盘. (line 127) * input rewriting: Defining Package Variants. (line 161) * inputattach: 其它各种服务. (line 112) * inputs, of packages: 软件包引用. (line 54) * insert or update copyright: 完美的配置. (line 57) * installation image: 构建安装镜像. (line 6) * installing Guix System: 系统安装. (line 6) * installing over SSH: 键盘布局、网络和分区. (line 94) * installing packages: 调用guix package. (line 6) * integrity checking: 调用guix gc. (line 155) * integrity, of the store: 调用guix gc. (line 155) * interactive shell: Shells Home Services. (line 6) * interactive use: Using Guix Interactively. (line 6) * invalid store items: 仓库. (line 103) * Invoking guix import: 调用guix import. (line 6) * invoking programs, from Scheme: Build Utilities. (line 213) * IPFS: 网络服务. (line 1219) * iptables: 网络服务. (line 107) * IRC (Internet Relay Chat): 消息服务. (line 390) * IRC (Internet Relay Chat) <1>: 消息服务. (line 428) * IRC gateway: 消息服务. (line 390) * ISO-9660 format: 调用guix system. (line 412) * issue tracking: The Issue Tracker. (line 6) * jabber: 消息服务. (line 6) * jackd: 基础服务. (line 809) * jami, service: 电话服务. (line 12) * java: Java包. (line 6) * JSON: 调用guix describe. (line 76) * JSON, import: 调用guix import. (line 196) * keepalived: 网络服务. (line 1244) * Kerberos: Kerberos服务. (line 6) * kernel module loader: Linux Services. (line 60) * keyboard layout: 键盘布局、网络和分区. (line 13) * keyboard layout <1>: 键盘布局. (line 6) * keyboard layout, configuration: 键盘布局. (line 83) * keyboard layout, definition: 键盘布局. (line 15) * keyboard layout, for the bootloader: 引导设置. (line 138) * keyboard layout, for Xorg: X窗口. (line 492) * keymap: 键盘布局. (line 6) * keymap, for Xorg: X窗口. (line 492) * l10n: 撰写文档. (line 38) * latest commit, building: 软件包转换选项. (line 205) * LaTeX packages: Using TeX and LaTeX. (line 6) * ld-wrapper: The GCC toolchain. (line 6) * LDAP: LDAP Services. (line 6) * legacy boot, on Intel machines: 使用配置系统. (line 79) * Let’s Encrypt: 证书服务. (line 6) * license, GNU Free Documentation License: GNU自由文档许可证. (line 6) * license, of packages: 软件包引用. (line 155) * lightdm, graphical login manager: X窗口. (line 288) * linker wrapper: The GCC toolchain. (line 6) * lint, code style: Invoking guix style. (line 6) * lirc: 其它各种服务. (line 85) * locale: 区域. (line 6) * locale definition: 区域. (line 12) * locale name: 区域. (line 68) * locales, when not on Guix System: 设置应用程序. (line 13) * lock files: Replicating Guix. (line 39) * log rotation: 日志轮替. (line 6) * logging: 基础服务. (line 446) * logging <1>: 日志轮替. (line 6) * logging, anonymization: 日志轮替. (line 133) * login manager: X窗口. (line 6) * login manager <1>: X窗口. (line 184) * login shell: Shells Home Services. (line 6) * loopback device: Networking Setup. (line 163) * lowering, of high-level objects in gexps: G-表达式. (line 45) * lowering, of high-level objects in gexps <1>: G-表达式. (line 517) * LUKS: 映射的设备. (line 67) * LVM, logical volume manager: 映射的设备. (line 61) * M-x copyright-update: 完美的配置. (line 57) * M-x guix-copyright: 完美的配置. (line 57) * mail: 邮件服务. (line 6) * mail transfer agent (MTA): 邮件服务. (line 1208) * man pages: 文档. (line 6) * manifest: 书写清单. (line 6) * manifest, exporting: 调用guix package. (line 525) * manifest, exporting <1>: Invoking guix shell. (line 190) * manual pages: 文档. (line 6) * mapped devices: 映射的设备. (line 6) * mcron: 执行计划任务. (line 6) * mcron <1>: Mcron Home Service. (line 6) * message of the day: 基础服务. (line 86) * messaging: 消息服务. (line 6) * meta-data, channels: Declaring Channel Dependencies. (line 6) * minetest: 调用guix import. (line 96) * ModemManager: Networking Setup. (line 313) * Modeswitching: Networking Setup. (line 329) * modprobe: Linux Services. (line 60) * module closure: G-表达式. (line 114) * module, black-listing: 初始的内存虚拟硬盘. (line 112) * monad: 仓库monad. (line 6) * monadic functions: 仓库monad. (line 18) * monadic values: 仓库monad. (line 18) * mouse: 基础服务. (line 702) * mpd: 音频服务. (line 9) * MTA (mail transfer agent): 邮件服务. (line 1208) * multiple-output packages: 有多个输出的软件包. (line 6) * Mumble: 电话服务. (line 208) * Mumi, Debbugs Web interface: Web服务. (line 680) * Murmur: 电话服务. (line 208) * name mapper: 网络文件系统. (line 145) * name service cache daemon: 基础服务. (line 355) * name service caching daemon (nscd): 设置应用程序. (line 60) * name service switch: Name Service Switch. (line 6) * name service switch, glibc: 设置应用程序. (line 60) * nar bundle, archive format: 调用guix archive. (line 48) * nar, archive format: 调用guix archive. (line 48) * native language support: 撰写文档. (line 37) * Network information service (NIS): 设置应用程序. (line 71) * network interface controller (NIC): Networking Setup. (line 30) * networking, with QEMU: Networking Setup. (line 168) * NetworkManager: Networking Setup. (line 193) * news, for channels: Writing Channel News. (line 6) * NFS: 网络文件系统. (line 6) * NFS, server: 网络文件系统. (line 17) * nftables: 网络服务. (line 150) * NIC, networking interface controller: Networking Setup. (line 30) * NIS (Network information service): 设置应用程序. (line 71) * Nix: 其它各种服务. (line 370) * nofile: 基础服务. (line 809) * non-determinism, in package builds: 调用guix challenge. (line 69) * normalized archive (nar): 调用guix archive. (line 48) * normalized codeset in locale names: 区域. (line 68) * nscd: 基础服务. (line 355) * nscd (name service caching daemon): 设置应用程序. (line 60) * nscd, cache invalidation: 基础服务. (line 365) * nslcd, LDAP service: LDAP Services. (line 6) * NSS: Name Service Switch. (line 6) * NSS (name service switch), glibc: 设置应用程序. (line 60) * nss-certs: 设置应用程序. (line 140) * nss-certs <1>: X.509证书. (line 20) * nss-mdns: Name Service Switch. (line 21) * nsswitch.conf: 设置应用程序. (line 67) * NTP (Network Time Protocol), service: 网络服务. (line 171) * ntpd, service for the Network Time Protocol daemon: 网络服务. (line 171) * OCaml: 调用guix import. (line 379) * on-error: 调用guix system. (line 459) * on-error strategy: 调用guix system. (line 459) * one-shot services, for the Shepherd: Shepherd服务. (line 42) * oom: Linux Services. (line 6) * OPAM: 调用guix import. (line 379) * open file descriptors: 基础服务. (line 809) * opendht, distributed hash table network service: 网络服务. (line 356) * OpenNTPD: 网络服务. (line 222) * OpenPGP, signed commits: 提交权利. (line 57) * optimization, of package code: 软件包转换选项. (line 22) * out of memory killer: Linux Services. (line 6) * outputs: 有多个输出的软件包. (line 6) * pack: 调用guix pack. (line 15) * package building: 调用guix build. (line 6) * package conversion: 调用guix import. (line 6) * package definition, editing: 调用guix edit。. (line 6) * package dependencies: 调用guix gc. (line 122) * package dependencies <1>: 调用guix graph. (line 6) * package import: 调用guix import. (line 6) * package installation: 调用guix package. (line 6) * package module search path: 软件包模块. (line 19) * package multi-versioning: 软件包转换选项. (line 22) * package outputs: 有多个输出的软件包. (line 6) * package removal: 调用guix package. (line 6) * package size: 调用guix size. (line 6) * package transformations: Defining Package Variants. (line 125) * package transformations, upgrades: 调用guix package. (line 205) * package variants: 软件包转换选项. (line 6) * package, checking for errors: 调用guix lint. (line 6) * packages: 软件包管理. (line 6) * PAM: 操作系统参考. (line 174) * pam-krb5: Kerberos服务. (line 88) * pam-mount: PAM Mount Service. (line 6) * password, for user accounts: 用户帐号. (line 89) * patch submissions, tracking: The Issue Tracker. (line 6) * patches: 定义软件包. (line 71) * Patchwork: Web服务. (line 511) * pattern matching: 数据类型和模式匹配. (line 10) * pcscd: 其它各种服务. (line 58) * performance, tuning code: 软件包转换选项. (line 22) * perl: Perl模块. (line 6) * persistent environment: Invoking guix shell. (line 374) * persistent environment <1>: 调用guix environment. (line 121) * personal packages (channels): 创建一个频道. (line 6) * php-fpm: Web服务. (line 758) * PID 1: Shepherd服务. (line 6) * pinning, channel revisions of a profile: 调用guix package. (line 543) * pinning, channels: Invoking guix time-machine. (line 6) * pinning, channels <1>: Replicating Guix. (line 6) * pipefs: 网络文件系统. (line 109) * Platform Reliability, Availability and Serviceability daemon: Linux Services. (line 92) * pluggable authentication modules: 操作系统参考. (line 174) * POP: 邮件服务. (line 1237) * postgis: 数据库服务. (line 67) * postgresql extension-packages: 数据库服务. (line 61) * power management: Power Management Home Services. (line 6) * power management with TLP: 电源管理服务. (line 6) * pre-built binaries: substitutes. (line 6) * primary URL, channels: Primary URL. (line 6) * printer support with CUPS: 打印服务. (line 6) * priority: 基础服务. (line 809) * profile: 入门. (line 26) * profile <1>: 调用guix package. (line 6) * profile <2>: 调用guix package. (line 42) * profile collisions: 调用guix package. (line 354) * profile declaration: 调用guix package. (line 233) * profile manifest: 调用guix package. (line 233) * profile, choosing: 调用guix package. (line 324) * program invocation, from Scheme: Build Utilities. (line 213) * program wrappers: Build Utilities. (line 338) * prometheus-node-exporter: 监控服务. (line 136) * propagated inputs: 调用guix package. (line 87) * provenance tracking, of software artifacts: 功能. (line 75) * provenance tracking, of the home environment: Invoking guix home. (line 124) * provenance tracking, of the operating system: 调用guix system. (line 93) * provenance tracking, of the operating system <1>: 调用guix system. (line 389) * provenance tracking, of the operating system <2>: 服务参考. (line 216) * proxy, during system installation: 键盘布局、网络和分区. (line 87) * proxy, for guix-daemon HTTP access: 基础服务. (line 563) * pull: 调用guix pull. (line 6) * PulseAudio, sound support: 声音服务. (line 6) * pypi: 调用guix import. (line 48) * python: Python模块. (line 6) * Python软件包的输入: Python模块. (line 40) * QEMU: 在虚拟机里运行Guix. (line 22) * QEMU, networking: Networking Setup. (line 168) * quote: 定义软件包. (line 89) * quoting: 定义软件包. (line 89) * rasdaemon: Linux Services. (line 92) * read-eval-print loop: 在安装之前运行Guix. (line 28) * real time clock: 网络服务. (line 171) * realm, kerberos: Kerberos服务. (line 54) * realtime: 基础服务. (line 809) * references: Derivations. (line 38) * relocatable binaries: 调用guix pack. (line 141) * relocatable binaries, with guix pack: 调用guix pack. (line 46) * remote access to the daemon: 调用guix-daemon. (line 236) * remote access to the daemon <1>: 仓库. (line 47) * remote build: 持续集成. (line 120) * removing packages: 调用guix package. (line 6) * repairing GRUB, via chroot: System Troubleshooting Tips. (line 14) * repairing store items: 额外的构建选项. (line 221) * repairing the store: 调用guix gc. (line 169) * REPL: 在安装之前运行Guix. (line 28) * REPL, read-eval-print loop: Using Guix Interactively. (line 6) * REPL, read-eval-print loop, script: 调用guix repl. (line 6) * replacements of packages, for grafts: 安全更新. (line 38) * replicating Guix: Invoking guix time-machine. (line 6) * replicating Guix <1>: 调用guix describe. (line 6) * replicating Guix <2>: Replicating Guix. (line 6) * replication, of software environments: 功能. (line 75) * reproducibility: 功能. (line 50) * reproducibility <1>: 调用guix describe. (line 6) * reproducibility, checking: 额外的构建选项. (line 208) * reproducibility, of Guix: Invoking guix time-machine. (line 6) * reproducibility, of Guix <1>: Replicating Guix. (line 6) * reproducible build environments: Invoking guix shell. (line 6) * resolution: 引导设置. (line 278) * resolution <1>: 调用guix system. (line 20) * reverting commits: 提交权利. (line 161) * roll-back, of the operating system: 使用配置系统. (line 393) * rolling back: 调用guix package. (line 259) * rolling back <1>: 调用guix pull. (line 134) * rolling back <2>: 调用guix system. (line 159) * rolling back <3>: Invoking guix home. (line 167) * rottlog: 日志轮替. (line 6) * rpcbind: 网络文件系统. (line 88) * rpc_pipefs: 网络文件系统. (line 109) * rshiny: 其它各种服务. (line 330) * run-time dependencies: Derivations. (line 38) * RUNPATH, validation: 构建系统. (line 99) * RUNPATH, validation <1>: Build Phases. (line 56) * rust: Rust Crates. (line 6) * Rust programming language: 构建系统. (line 224) * RYF, Respects Your Freedom: 硬件的考虑. (line 27) * Samba: Samba Services. (line 6) * saving space: 调用guix system. (line 169) * saving space <1>: Invoking guix home. (line 172) * scanner access: 桌面服务. (line 365) * scheduling jobs: 执行计划任务. (line 6) * scheduling jobs <1>: Mcron Home Service. (line 6) * Scheme programming language, getting started: 定义软件包. (line 119) * search path: Search Paths. (line 6) * search paths: 调用guix package. (line 46) * search paths <1>: 调用guix package. (line 289) * searching for documentation: 文档. (line 6) * searching for packages: 调用guix package. (line 371) * secure shell client, configuration: Secure Shell. (line 6) * security: substitute服务器授权. (line 6) * security updates: 安全更新. (line 6) * security vulnerabilities: 调用guix lint. (line 74) * security vulnerabilities <1>: 安全更新. (line 6) * security, guix pull: 调用guix pull. (line 6) * SELinux,后台进程策略: SELinux的支持. (line 6) * SELinux,安装策略: SELinux的支持. (line 13) * SELinux,限制: SELinux的支持. (line 30) * service extension graph, of a home environment: Invoking guix home. (line 239) * service extensions: 合成服务. (line 18) * service type: 服务参考. (line 98) * service type definition, editing: 调用guix system. (line 57) * service type definition, editing <1>: Invoking guix home. (line 90) * service types: 合成服务. (line 43) * services: 使用配置系统. (line 134) * services <1>: 合成服务. (line 6) * session limits: 基础服务. (line 809) * session types: X窗口. (line 31) * setgid programs: setuid程序. (line 6) * setuid programs: setuid程序. (line 6) * sh, in /bin: 基础服务. (line 34) * sharing store items across machines: 调用guix copy. (line 6) * shell: Shells Home Services. (line 6) * shell <1>: Invoking guix home. (line 21) * shell-profile: Invoking guix home. (line 21) * Shepherd dependency graph, for a home environment: Invoking guix home. (line 253) * shepherd services: Shepherd服务. (line 6) * shepherd services, for users: Shepherd Home Service. (line 6) * shortest path, between packages: 调用guix graph. (line 145) * signing, archives: 调用guix archive. (line 98) * SIMD support: 软件包转换选项. (line 22) * simple Clojure build system: 构建系统. (line 334) * Singularity, build an image with guix pack: 调用guix pack. (line 70) * Singularity, container service: 其它各种服务. (line 281) * size: 调用guix size. (line 6) * SMB: Samba Services. (line 6) * SMTP: 邮件服务. (line 1208) * snippets, when to use: Snippets versus Phases. (line 6) * socket activation, for guix publish: 调用guix publish. (line 40) * socket activation, for guix-daemon: 调用guix-daemon. (line 11) * software bundle: 调用guix pack. (line 15) * software development: 开发. (line 6) * Software Heritage, source code archive: 调用guix lint. (line 49) * sound support: 声音服务. (line 6) * source, verification: 额外的构建选项. (line 113) * spice: 其它各种服务. (line 101) * SQL: 数据库服务. (line 6) * SquashFS, build an image with guix pack: 调用guix pack. (line 70) * SSH: 网络服务. (line 626) * SSH <1>: 网络服务. (line 663) * SSH <2>: 在虚拟机里运行Guix. (line 82) * SSH access to build daemons: 仓库. (line 63) * SSH authorized keys: 网络服务. (line 791) * SSH client, configuration: Secure Shell. (line 6) * SSH server: 网络服务. (line 626) * SSH server <1>: 网络服务. (line 663) * SSH server <2>: 在虚拟机里运行Guix. (line 82) * SSH, copy of store items: 调用guix copy. (line 6) * stackage: 调用guix import. (line 279) * staging, of code: Build Phases. (line 186) * staging, of code <1>: G-表达式. (line 12) * state monad: 仓库monad. (line 157) * statistics, for substitutes: 调用guix weather. (line 13) * store items: 仓库. (line 6) * store paths: 仓库. (line 6) * strata of code: G-表达式. (line 12) * styling rules: Invoking guix style. (line 6) * subdirectory, channels: Package Modules in a Sub-directory. (line 6) * substitute availability: 调用guix weather. (line 13) * substitute servers, adding more: Getting Substitutes from Other Servers. (line 6) * substitutes: 调用guix-daemon. (line 51) * substitutes <1>: 功能. (line 60) * substitutes <2>: substitutes. (line 6) * substitutes <3>: 打包指导. (line 41) * substitutes, how to disable: substitute服务器授权. (line 52) * substitutes,对其授权: 二进制文件安装. (line 145) * substitutes,对其授权 <1>: substitute服务器授权. (line 6) * substitutes,对其授权 <2>: 基础服务. (line 480) * sudo vs. guix pull: 系统安装之后. (line 17) * sudoers file: 操作系统参考. (line 181) * swap devices: 操作系统参考. (line 96) * swap encryption: 映射的设备. (line 91) * swap space: Swap Space. (line 6) * symbolic links, guix shell: Invoking guix shell. (line 338) * syncthing: 网络服务. (line 581) * sysctl: 其它各种服务. (line 18) * syslog: 基础服务. (line 446) * syslog <1>: 基础服务. (line 455) * system configuration: 系统配置. (line 6) * system images: System Images. (line 6) * System images, creation in various formats: 调用guix system. (line 270) * system service: 合成服务. (line 35) * system services: 服务. (line 6) * tablet input, for Xorg: 其它各种服务. (line 115) * teams: 发送补丁系列. (line 60) * teams <1>: Teams. (line 6) * telephony, services: 电话服务. (line 6) * test suite, skipping: 软件包转换选项. (line 292) * TeX Live: 调用guix import. (line 181) * TeX packages: Using TeX and LaTeX. (line 6) * the Hurd: 虚拟化服务. (line 648) * thermald: 电源管理服务. (line 432) * tlp: 电源管理服务. (line 6) * TLS: X.509证书. (line 6) * TLS certificates: 证书服务. (line 6) * tool chain, changing the build tool chain of a package: 软件包转换选项. (line 172) * tool chain, choosing a package’s tool chain: 软件包引用. (line 250) * toolchain, for C development: The GCC toolchain. (line 6) * toolchain, for Fortran development: The GCC toolchain. (line 6) * Tor: 网络服务. (line 412) * touchscreen input, for Xorg: 其它各种服务. (line 115) * transactions: 功能. (line 30) * transactions <1>: 调用guix package. (line 16) * transactions, undoing: 调用guix package. (line 259) * transactions, undoing <1>: 调用guix pull. (line 134) * transferring store items across machines: 调用guix copy. (line 6) * translation: 撰写文档. (line 38) * troubleshooting, guix system: 构建安装镜像. (line 30) * trust, of pre-built binaries: 关于信任二进制文件. (line 6) * tunable packages: 软件包转换选项. (line 22) * tuning, of package code: 软件包转换选项. (line 22) * UEFI boot: 使用配置系统. (line 79) * UEFI, bootloader: 引导设置. (line 20) * UEFI, installation: 键盘布局、网络和分区. (line 118) * ulimit: 基础服务. (line 809) * unattended upgrades: Unattended Upgrades. (line 6) * undoing transactions: 调用guix package. (line 259) * undoing transactions <1>: 调用guix pull. (line 134) * update-guix-package, updating the guix package: 更新Guix软件包. (line 6) * updating Guix: 调用guix pull. (line 6) * upgrades, unattended: Unattended Upgrades. (line 6) * upgrading Guix: 调用guix pull. (line 6) * upgrading Guix for the root user, on a foreign distro: Upgrading Guix. (line 12) * Upgrading Guix, on a foreign distro: Upgrading Guix. (line 6) * upgrading packages: 调用guix package. (line 196) * upgrading the Guix daemon, on a foreign distro: Upgrading Guix. (line 12) * upstream, latest version: 软件包转换选项. (line 263) * USB_ModeSwitch: Networking Setup. (line 329) * user accounts: 用户帐号. (line 6) * users: 用户帐号. (line 6) * usertags, for debbugs: Debbugs Usertags. (line 6) * vacuum the store database: 调用guix gc. (line 188) * variant packages (channels): Specifying Additional Channels. (line 6) * variants, of packages: Defining Package Variants. (line 6) * Varnish: Web服务. (line 437) * verbosity, of the command-line tools: 普通的构建选项. (line 98) * verifiable builds: 调用guix challenge. (line 6) * Vim,编辑Scheme代码: 格式化代码. (line 24) * virtual machine: 调用guix system. (line 212) * virtual machine <1>: 在虚拟机里运行Guix. (line 6) * virtual machine, Guix System installation: 在虚拟机里安装 Guix. (line 6) * virtual private network (VPN): VPN服务. (line 6) * virtual private server (VPS): 在虚拟机里安装 Guix. (line 6) * VM: 调用guix system. (line 212) * VNC (virtual network computing): VNC Services. (line 6) * VoIP server: 电话服务. (line 208) * VPN (virtual private network): VPN服务. (line 6) * VPS (virtual private server): 在虚拟机里安装 Guix. (line 6) * weather, substitute availability: 调用guix weather. (line 13) * web: Web服务. (line 6) * Web: 证书服务. (line 6) * WebSSH: 网络服务. (line 945) * wesnothd: 游戏服务. (line 9) * Wi-Fi access points, hostapd service: 网络服务. (line 52) * WiFi: 键盘布局、网络和分区. (line 50) * WiFi, hardware support: 硬件的考虑. (line 15) * window manager: X窗口. (line 15) * wireless: 键盘布局、网络和分区. (line 50) * WPA Supplicant: Networking Setup. (line 279) * wrapping programs: Build Utilities. (line 338) * wsdd, Web service discovery daemon: Samba Services. (line 74) * www: Web服务. (line 6) * X Window System: X窗口. (line 6) * X.509 certificates: X.509证书. (line 6) * X11: X窗口. (line 6) * X11 login: X窗口. (line 184) * XDMCP (x display manager control protocol): VNC Services. (line 6) * XKB, keyboard layouts: 键盘布局. (line 34) * xlsfonts: 设置应用程序. (line 134) * XMPP: 消息服务. (line 6) * Xorg, configuration: X窗口. (line 465) * xterm: 设置应用程序. (line 123) * zabbix zabbix-agent: 监控服务. (line 248) * zabbix zabbix-front-end: 监控服务. (line 310) * zabbix zabbix-server: 监控服务. (line 170) * zram: Linux Services. (line 160) * zsh: Shells Home Services. (line 6) * zsh <1>: Invoking guix home. (line 21) * 下发: 下发工作给后台进程的设置. (line 6) * 下发 <1>: 调用guix-daemon. (line 70) * 下发测试: 下发工作给后台进程的设置. (line 152) * 下发状态: 下发工作给后台进程的设置. (line 169) * 下载Guix二进制文件: 二进制文件安装. (line 37) * 仓库: 以Guix的方式管理软件. (line 28) * 仓库 <1>: 仓库. (line 6) * 代码格式化: 格式化代码. (line 17) * 代码片段: 完美的配置. (line 28) * 代码缩进: 格式化代码. (line 17) * 代码风格: 格式化代码. (line 6) * 减少样板: 完美的配置. (line 28) * 函数式包管理器: 以Guix的方式管理软件. (line 19) * 分支策略: 提交补丁. (line 83) * 别的发行版: 安装. (line 11) * 别的发行版 <1>: 设置应用程序. (line 6) * 去重: 调用guix-daemon. (line 176) * 去重 <1>: 调用guix gc. (line 178) * 发行版的扩展性: 以Guix的方式管理软件. (line 13) * 可复现的构建: 调用guix-daemon. (line 17) * 可复现的构建 <1>: 功能. (line 50) * 可复现的构建 <2>: 验证substitute. (line 18) * 可复现的构建 <3>: 调用guix challenge. (line 6) * 后台进程: 设置后台进程. (line 6) * 和foreign distro相关的文件夹: 安装. (line 11) * 垃圾收集的根: 调用guix-daemon. (line 186) * 垃圾收集的根 <1>: 调用guix gc. (line 12) * 字体: 设置应用程序. (line 101) * 字体 <1>: 字体. (line 6) * 安全,guix-daemon: SELinux的支持. (line 6) * 安装Guix: 安装. (line 6) * 安装脚本: 二进制文件安装. (line 6) * 官方网站: 需求. (line 10) * 定制软件包: 以Guix的方式管理软件. (line 13) * 定制软件包 <1>: 软件包模块. (line 19) * 容器: Invoking guix shell. (line 262) * 容器 <1>: 调用guix environment. (line 87) * 容器 <2>: 调用guix environment. (line 253) * 容器 <3>: 调用guix container. (line 6) * 容器,构建环境: 调用guix-daemon. (line 17) * 强制访问控制,SELinux: SELinux的支持. (line 6) * 归档: 调用guix archive. (line 6) * 构建: 提交补丁. (line 62) * 构建后台进程: 以Guix的方式管理软件. (line 9) * 构建环境: 设置构建环境. (line 6) * 构建环境 <1>: 调用guix-daemon. (line 17) * 构建用户: 设置构建环境. (line 11) * 构建过程的确定性: 提交补丁. (line 116) * 构建钩子: 下发工作给后台进程的设置. (line 6) * 格式化代码: 格式化代码. (line 6) * 检查可复现的构建: 提交补丁. (line 116) * 模板: 完美的配置. (line 28) * 测试套件: 运行测试套件. (line 6) * 状态文件夹: 需求. (line 61) * 用二进制文件安装Guix: 二进制文件安装. (line 6) * 用于版本控制快照的版本号: 版本号. (line 33) * 用户界面: 以Guix的方式管理软件. (line 6) * 目的: 介绍. (line 6) * 秘密,Knot服务。: DNS服务. (line 415) * 自由软件: 软件自由. (line 6) * 行为准则和贡献者: 贡献. (line 11) * 补丁系列: 发送补丁系列. (line 6) * 贡献者契约: 贡献. (line 11) * 软件包, 创建: 打包指导. (line 6) * 软件包名字: 软件包命名. (line 6) * 软件包描述: 简介和描述. (line 6) * 软件包描述里的Texinfo标记: 简介和描述. (line 28) * 软件包版本: 版本号. (line 6) * 软件包简介: 简介和描述. (line 6) * 重新构建的调度策略: 提交补丁. (line 83) * 隔离: 以Guix的方式管理软件. (line 19)