This section summarizes all the options available in
declarations (see 使用配置系统).
This is the data type representing an operating system configuration. By that, we mean all the global system configuration, not per-user configuration (see 使用配置系统).
The package object of the operating system kernel to use22.
The package object of the Hurd to be started by the kernel. When this field
is set, produce a GNU/Hurd operating system. In that case,
must also be set to the
gnumach package—the microkernel the Hurd
Warning: This feature is experimental and only supported for disk images.
A list of objects (usually packages) to collect loadable kernel modules
List of strings or gexps representing additional arguments to pass on the
command-line of the kernel—e.g.,
The system bootloader configuration object. See 引导设置.
This is the label (a string) as it appears in the bootloader’s menu entry. The default label includes the kernel name and version.
This field specifies the keyboard layout to use in the console. It can be
#f, in which case the default keyboard layout is used (usually
US English), or a
<keyboard-layout> record. See 键盘布局,
for more information.
This keyboard layout is in effect as soon as the kernel has booted. For
instance, it is the keyboard layout in effect when you type a passphrase if
your root file system is on a
luks-device-mapping mapped device
注: This does not specify the keyboard layout used by the bootloader, nor that used by the graphical display server. See 引导设置, for information on how to specify the bootloader’s keyboard layout. See X窗口, for information on how to specify the keyboard layout used by the X Window System.
The list of Linux kernel modules that need to be available in the initial RAM disk. See 初始的内存虚拟硬盘.
A procedure that returns an initial RAM disk for the Linux kernel. This field is provided to support low-level customization and should rarely be needed for casual use. See 初始的内存虚拟硬盘.
List of firmware packages loadable by the operating system kernel.
The default includes firmware needed for Atheros- and Broadcom-based WiFi
devices (Linux-libre modules
respectively). See 硬件的考虑, for more info on supported
The host name.
A file-like object (see file-like objects) for use as
/etc/hosts (see Host Names in The GNU C Library Reference
Manual). The default is a file with entries for
A list of mapped devices. See 映射的设备.
A list of file systems. See 文件系统.
A list of UUIDs, file system labels, or strings identifying devices or files to be used for “swap space” (see Memory Concepts in The GNU C Library Reference Manual). Here are some examples:
(list (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb"))
Use the swap partition with the given UUID. You can learn the UUID of a
Linux swap partition by running
swaplabel device, where
device is the /dev file name of that partition.
(list (file-system-label "swap"))
Use the partition with label
swap. Again, the
command allows you to view and change the label of a Linux swap partition.
Use the file /swapfile as swap space.
(list "/dev/sda3" "/dev/sdb2")
Use the /dev/sda3 and /dev/sdb2 partitions as swap space. We recommend referring to swap devices by UUIDs or labels as shown above instead.
It is possible to specify a swap file in a file system on a mapped device (under /dev/mapper), provided that the necessary device mapping and file system are also specified. See 映射的设备 and 文件系统.
List of user accounts and groups. See 用户帐号.
users list lacks a user account with UID 0, a “root”
account with UID 0 is automatically added.
A list of target file name/file-like object tuples (see file-like objects). These are the skeleton files that will be added to the home directory of newly-created user accounts.
For instance, a valid value may look like this:
`((".bashrc" ,(plain-file "bashrc" "echo Hello\n")) (".guile" ,(plain-file "guile" "(use-modules (ice-9 readline)) (activate-readline)")))
A string denoting the contents of the /etc/issue file, which is displayed when users log in on a text console.
A list of packages to be installed in the global profile, which is accessible at /run/current-system/profile. Each element is either a package variable or a package/output tuple. Here’s a simple example of both:
(cons* git ; the default "out" output (list git "send-email") ; another output of git %base-packages) ; the default set
The default set includes core utilities and it is good practice to install non-core utilities in user profiles (see 调用guix package).
A timezone identifying string—e.g.,
You can run the
tzselect command to find out which timezone string
corresponds to your region. Choosing an invalid timezone name causes
guix system to fail.
The name of the default locale (see Locale Names in The GNU C Library Reference Manual). See 区域, for more information.
The list of locale definitions to be compiled and that may be used at run time. See 区域.
The list of GNU libc packages whose locale data and tools are used to build the locale definitions. See 区域, for compatibility considerations that justify this option.
Configuration of the libc name service switch (NSS)—a
<name-service-switch> object. See Name Service Switch, for
A list of service objects denoting system services. See 服务.
The list of “essential services”—i.e., things like instances of
host-name-service-type (see 服务参考), which are derived from the operating system definition itself.
As a user you should never need to touch this field.
Linux pluggable authentication module (PAM) services.
List of string-valued G-expressions denoting setuid programs. See setuid程序.
The contents of the /etc/sudoers file as a file-like object
This file specifies which users can use the
sudo command, what
they are allowed to do, and what privileges they may gain. The default is
root and members of the
wheel group may use
When used in the lexical scope of an operating system field definition, this identifier resolves to the operating system being defined.
The example below shows how to refer to the operating system being defined
in the definition of the
(use-modules (gnu) (guix)) (operating-system ;; ... (label (package-full-name (operating-system-kernel this-operating-system))))
It is an error to refer to
this-operating-system outside an operating
Currently only the Linux-libre kernel is fully supported. Using GNU mach with the GNU Hurd is experimental and only available when building a virtual machine disk image.