nixos/system: invariant option docs MD conversions

pennae 860a0449 cbc44d68

Changed files
+80 -80
nixos
modules
system
boot
loader
generations-dir
systemd
etc
+5 -5
nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
···
enable = mkOption {
default = false;
type = types.bool;
-
description = ''
Whether to create symlinks to the system generations under
-
<literal>/boot</literal>. When enabled,
-
<literal>/boot/default/kernel</literal>,
-
<literal>/boot/default/initrd</literal>, etc., are updated to
point to the current generation's kernel image, initial RAM
disk, and other bootstrap files.
···
copyKernels = mkOption {
default = false;
type = types.bool;
-
description = ''
Whether copy the necessary boot files into /boot, so
/nix/store is not needed by the boot loader.
'';
···
enable = mkOption {
default = false;
type = types.bool;
+
description = lib.mdDoc ''
Whether to create symlinks to the system generations under
+
`/boot`. When enabled,
+
`/boot/default/kernel`,
+
`/boot/default/initrd`, etc., are updated to
point to the current generation's kernel image, initial RAM
disk, and other bootstrap files.
···
copyKernels = mkOption {
default = false;
type = types.bool;
+
description = lib.mdDoc ''
Whether copy the necessary boot files into /boot, so
/nix/store is not needed by the boot loader.
'';
+35 -35
nixos/modules/system/boot/systemd.nix
···
default = pkgs.systemd;
defaultText = literalExpression "pkgs.systemd";
type = types.package;
-
description = "The systemd package.";
};
systemd.units = mkOption {
-
description = "Definition of systemd units.";
default = {};
type = systemdUtils.types.units;
};
···
default = [];
type = types.listOf types.package;
example = literalExpression "[ pkgs.systemd-cryptsetup-generator ]";
-
description = "Packages providing systemd units and hooks.";
};
systemd.targets = mkOption {
default = {};
type = systemdUtils.types.targets;
-
description = "Definition of systemd target units.";
};
systemd.services = mkOption {
default = {};
type = systemdUtils.types.services;
-
description = "Definition of systemd service units.";
};
systemd.sockets = mkOption {
default = {};
type = systemdUtils.types.sockets;
-
description = "Definition of systemd socket units.";
};
systemd.timers = mkOption {
default = {};
type = systemdUtils.types.timers;
-
description = "Definition of systemd timer units.";
};
systemd.paths = mkOption {
default = {};
type = systemdUtils.types.paths;
-
description = "Definition of systemd path units.";
};
systemd.mounts = mkOption {
default = [];
type = systemdUtils.types.mounts;
-
description = ''
Definition of systemd mount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
the 'where' attribute.
···
systemd.automounts = mkOption {
default = [];
type = systemdUtils.types.automounts;
-
description = ''
Definition of systemd automount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
the 'where' attribute.
···
systemd.slices = mkOption {
default = {};
type = systemdUtils.types.slices;
-
description = "Definition of slice configurations.";
};
systemd.generators = mkOption {
type = types.attrsOf types.path;
default = {};
example = { systemd-gpt-auto-generator = "/dev/null"; };
-
description = ''
Definition of systemd generators.
-
For each <literal>NAME = VALUE</literal> pair of the attrSet, a link is generated from
-
<literal>/etc/systemd/system-generators/NAME</literal> to <literal>VALUE</literal>.
'';
};
systemd.shutdown = mkOption {
type = types.attrsOf types.path;
default = {};
-
description = ''
Definition of systemd shutdown executables.
-
For each <literal>NAME = VALUE</literal> pair of the attrSet, a link is generated from
-
<literal>/etc/systemd/system-shutdown/NAME</literal> to <literal>VALUE</literal>.
'';
};
systemd.defaultUnit = mkOption {
default = "multi-user.target";
type = types.str;
-
description = "Default unit started when the system boots.";
};
systemd.ctrlAltDelUnit = mkOption {
default = "reboot.target";
type = types.str;
example = "poweroff.target";
-
description = ''
Target that should be started when Ctrl-Alt-Delete is pressed.
'';
};
···
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
default = {};
example = { TZ = "CET"; };
-
description = ''
-
Environment variables passed to <emphasis>all</emphasis> systemd units.
'';
};
···
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
default = {};
example = { SYSTEMD_LOG_LEVEL = "debug"; };
-
description = ''
Environment variables of PID 1. These variables are
-
<emphasis>not</emphasis> passed to started units.
'';
};
systemd.enableCgroupAccounting = mkOption {
default = true;
type = types.bool;
-
description = ''
Whether to enable cgroup accounting.
'';
};
···
systemd.enableUnifiedCgroupHierarchy = mkOption {
default = true;
type = types.bool;
-
description = ''
Whether to enable the unified cgroup hierarchy (cgroupsv2).
'';
};
···
default = "";
type = types.lines;
example = "DefaultLimitCORE=infinity";
-
description = ''
Extra config options for systemd. See man systemd-system.conf for
available options.
'';
···
default = "";
type = types.lines;
example = "HibernateDelaySec=1h";
-
description = ''
Extra config options for systemd sleep state logic.
See sleep.conf.d(5) man page for available options.
'';
···
default = [ ];
type = types.listOf types.str;
example = [ "debug-shell.service" "systemd-quotacheck.service" ];
-
description = ''
Additional units shipped with systemd that shall be enabled.
'';
};
···
default = [ ];
type = types.listOf types.str;
example = [ "systemd-backlight@.service" ];
-
description = ''
A list of units to skip when generating system systemd configuration directory. This has
-
priority over upstream units, <option>systemd.units</option>, and
-
<option>systemd.additionalUpstreamSystemUnits</option>. The main purpose of this is to
prevent a upstream systemd unit from being added to the initrd with any modifications made to it
by other NixOS modules.
'';
···
type = types.nullOr types.path;
default = null;
example = "/dev/watchdog";
-
description = ''
The path to a hardware watchdog device which will be managed by systemd.
If not specified, systemd will default to /dev/watchdog.
'';
···
type = types.nullOr types.str;
default = null;
example = "30s";
-
description = ''
The amount of time which can elapse before a watchdog hardware device
will automatically reboot the system. Valid time units include "ms",
"s", "min", "h", "d", and "w".
···
type = types.nullOr types.str;
default = null;
example = "10m";
-
description = ''
The amount of time which can elapse after a reboot has been triggered
before a watchdog hardware device will automatically reboot the system.
Valid time units include "ms", "s", "min", "h", "d", and "w".
···
type = types.nullOr types.str;
default = null;
example = "10m";
-
description = ''
The amount of time which can elapse when kexec is being executed before
a watchdog hardware device will automatically reboot the system. This
option should only be enabled if reloadTime is also enabled. Valid
···
default = pkgs.systemd;
defaultText = literalExpression "pkgs.systemd";
type = types.package;
+
description = lib.mdDoc "The systemd package.";
};
systemd.units = mkOption {
+
description = lib.mdDoc "Definition of systemd units.";
default = {};
type = systemdUtils.types.units;
};
···
default = [];
type = types.listOf types.package;
example = literalExpression "[ pkgs.systemd-cryptsetup-generator ]";
+
description = lib.mdDoc "Packages providing systemd units and hooks.";
};
systemd.targets = mkOption {
default = {};
type = systemdUtils.types.targets;
+
description = lib.mdDoc "Definition of systemd target units.";
};
systemd.services = mkOption {
default = {};
type = systemdUtils.types.services;
+
description = lib.mdDoc "Definition of systemd service units.";
};
systemd.sockets = mkOption {
default = {};
type = systemdUtils.types.sockets;
+
description = lib.mdDoc "Definition of systemd socket units.";
};
systemd.timers = mkOption {
default = {};
type = systemdUtils.types.timers;
+
description = lib.mdDoc "Definition of systemd timer units.";
};
systemd.paths = mkOption {
default = {};
type = systemdUtils.types.paths;
+
description = lib.mdDoc "Definition of systemd path units.";
};
systemd.mounts = mkOption {
default = [];
type = systemdUtils.types.mounts;
+
description = lib.mdDoc ''
Definition of systemd mount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
the 'where' attribute.
···
systemd.automounts = mkOption {
default = [];
type = systemdUtils.types.automounts;
+
description = lib.mdDoc ''
Definition of systemd automount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
the 'where' attribute.
···
systemd.slices = mkOption {
default = {};
type = systemdUtils.types.slices;
+
description = lib.mdDoc "Definition of slice configurations.";
};
systemd.generators = mkOption {
type = types.attrsOf types.path;
default = {};
example = { systemd-gpt-auto-generator = "/dev/null"; };
+
description = lib.mdDoc ''
Definition of systemd generators.
+
For each `NAME = VALUE` pair of the attrSet, a link is generated from
+
`/etc/systemd/system-generators/NAME` to `VALUE`.
'';
};
systemd.shutdown = mkOption {
type = types.attrsOf types.path;
default = {};
+
description = lib.mdDoc ''
Definition of systemd shutdown executables.
+
For each `NAME = VALUE` pair of the attrSet, a link is generated from
+
`/etc/systemd/system-shutdown/NAME` to `VALUE`.
'';
};
systemd.defaultUnit = mkOption {
default = "multi-user.target";
type = types.str;
+
description = lib.mdDoc "Default unit started when the system boots.";
};
systemd.ctrlAltDelUnit = mkOption {
default = "reboot.target";
type = types.str;
example = "poweroff.target";
+
description = lib.mdDoc ''
Target that should be started when Ctrl-Alt-Delete is pressed.
'';
};
···
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
default = {};
example = { TZ = "CET"; };
+
description = lib.mdDoc ''
+
Environment variables passed to *all* systemd units.
'';
};
···
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
default = {};
example = { SYSTEMD_LOG_LEVEL = "debug"; };
+
description = lib.mdDoc ''
Environment variables of PID 1. These variables are
+
*not* passed to started units.
'';
};
systemd.enableCgroupAccounting = mkOption {
default = true;
type = types.bool;
+
description = lib.mdDoc ''
Whether to enable cgroup accounting.
'';
};
···
systemd.enableUnifiedCgroupHierarchy = mkOption {
default = true;
type = types.bool;
+
description = lib.mdDoc ''
Whether to enable the unified cgroup hierarchy (cgroupsv2).
'';
};
···
default = "";
type = types.lines;
example = "DefaultLimitCORE=infinity";
+
description = lib.mdDoc ''
Extra config options for systemd. See man systemd-system.conf for
available options.
'';
···
default = "";
type = types.lines;
example = "HibernateDelaySec=1h";
+
description = lib.mdDoc ''
Extra config options for systemd sleep state logic.
See sleep.conf.d(5) man page for available options.
'';
···
default = [ ];
type = types.listOf types.str;
example = [ "debug-shell.service" "systemd-quotacheck.service" ];
+
description = lib.mdDoc ''
Additional units shipped with systemd that shall be enabled.
'';
};
···
default = [ ];
type = types.listOf types.str;
example = [ "systemd-backlight@.service" ];
+
description = lib.mdDoc ''
A list of units to skip when generating system systemd configuration directory. This has
+
priority over upstream units, {option}`systemd.units`, and
+
{option}`systemd.additionalUpstreamSystemUnits`. The main purpose of this is to
prevent a upstream systemd unit from being added to the initrd with any modifications made to it
by other NixOS modules.
'';
···
type = types.nullOr types.path;
default = null;
example = "/dev/watchdog";
+
description = lib.mdDoc ''
The path to a hardware watchdog device which will be managed by systemd.
If not specified, systemd will default to /dev/watchdog.
'';
···
type = types.nullOr types.str;
default = null;
example = "30s";
+
description = lib.mdDoc ''
The amount of time which can elapse before a watchdog hardware device
will automatically reboot the system. Valid time units include "ms",
"s", "min", "h", "d", and "w".
···
type = types.nullOr types.str;
default = null;
example = "10m";
+
description = lib.mdDoc ''
The amount of time which can elapse after a reboot has been triggered
before a watchdog hardware device will automatically reboot the system.
Valid time units include "ms", "s", "min", "h", "d", and "w".
···
type = types.nullOr types.str;
default = null;
example = "10m";
+
description = lib.mdDoc ''
The amount of time which can elapse when kexec is being executed before
a watchdog hardware device will automatically reboot the system. This
option should only be enabled if reloadTime is also enabled. Valid
+20 -20
nixos/modules/system/boot/systemd/initrd.nix
···
};
contents = mkOption {
-
description = "Set of files that have to be linked into the initrd";
example = literalExpression ''
{
"/etc/hostname".text = "mymachine";
···
};
storePaths = mkOption {
-
description = ''
Store paths to copy into the initrd as well.
'';
type = with types; listOf (oneOf [ singleLineStr package ]);
···
};
extraBin = mkOption {
-
description = ''
Tools to add to /bin
'';
example = literalExpression ''
···
};
suppressedStorePaths = mkOption {
-
description = ''
Store paths specified in the storePaths option that
should not be copied.
'';
···
emergencyAccess = mkOption {
type = with types; oneOf [ bool singleLineStr ];
visible = false;
-
description = ''
Set to true for unauthenticated emergency access, and false for
no emergency access.
···
type = types.listOf types.package;
default = [];
visible = false;
-
description = ''
Packages to include in /bin for the stage 1 emergency shell.
'';
};
···
type = types.listOf types.str;
visible = false;
example = [ "debug-shell.service" "systemd-quotacheck.service" ];
-
description = ''
Additional units shipped with systemd that shall be enabled.
'';
};
···
type = types.listOf types.str;
example = [ "systemd-backlight@.service" ];
visible = false;
-
description = ''
A list of units to skip when generating system systemd configuration directory. This has
-
priority over upstream units, <option>boot.initrd.systemd.units</option>, and
-
<option>boot.initrd.systemd.additionalUpstreamUnits</option>. The main purpose of this is to
prevent a upstream systemd unit from being added to the initrd with any modifications made to it
by other NixOS modules.
'';
};
units = mkOption {
-
description = "Definition of systemd units.";
default = {};
visible = false;
type = systemdUtils.types.units;
···
visible = false;
type = types.listOf types.package;
example = literalExpression "[ pkgs.systemd-cryptsetup-generator ]";
-
description = "Packages providing systemd units and hooks.";
};
targets = mkOption {
default = {};
visible = false;
type = systemdUtils.types.initrdTargets;
-
description = "Definition of systemd target units.";
};
services = mkOption {
default = {};
type = systemdUtils.types.initrdServices;
visible = false;
-
description = "Definition of systemd service units.";
};
sockets = mkOption {
default = {};
type = systemdUtils.types.initrdSockets;
visible = false;
-
description = "Definition of systemd socket units.";
};
timers = mkOption {
default = {};
type = systemdUtils.types.initrdTimers;
visible = false;
-
description = "Definition of systemd timer units.";
};
paths = mkOption {
default = {};
type = systemdUtils.types.initrdPaths;
visible = false;
-
description = "Definition of systemd path units.";
};
mounts = mkOption {
default = [];
type = systemdUtils.types.initrdMounts;
visible = false;
-
description = ''
Definition of systemd mount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
the 'where' attribute.
···
default = [];
type = systemdUtils.types.automounts;
visible = false;
-
description = ''
Definition of systemd automount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
the 'where' attribute.
···
default = {};
type = systemdUtils.types.slices;
visible = false;
-
description = "Definition of slice configurations.";
};
};
···
};
contents = mkOption {
+
description = lib.mdDoc "Set of files that have to be linked into the initrd";
example = literalExpression ''
{
"/etc/hostname".text = "mymachine";
···
};
storePaths = mkOption {
+
description = lib.mdDoc ''
Store paths to copy into the initrd as well.
'';
type = with types; listOf (oneOf [ singleLineStr package ]);
···
};
extraBin = mkOption {
+
description = lib.mdDoc ''
Tools to add to /bin
'';
example = literalExpression ''
···
};
suppressedStorePaths = mkOption {
+
description = lib.mdDoc ''
Store paths specified in the storePaths option that
should not be copied.
'';
···
emergencyAccess = mkOption {
type = with types; oneOf [ bool singleLineStr ];
visible = false;
+
description = lib.mdDoc ''
Set to true for unauthenticated emergency access, and false for
no emergency access.
···
type = types.listOf types.package;
default = [];
visible = false;
+
description = lib.mdDoc ''
Packages to include in /bin for the stage 1 emergency shell.
'';
};
···
type = types.listOf types.str;
visible = false;
example = [ "debug-shell.service" "systemd-quotacheck.service" ];
+
description = lib.mdDoc ''
Additional units shipped with systemd that shall be enabled.
'';
};
···
type = types.listOf types.str;
example = [ "systemd-backlight@.service" ];
visible = false;
+
description = lib.mdDoc ''
A list of units to skip when generating system systemd configuration directory. This has
+
priority over upstream units, {option}`boot.initrd.systemd.units`, and
+
{option}`boot.initrd.systemd.additionalUpstreamUnits`. The main purpose of this is to
prevent a upstream systemd unit from being added to the initrd with any modifications made to it
by other NixOS modules.
'';
};
units = mkOption {
+
description = lib.mdDoc "Definition of systemd units.";
default = {};
visible = false;
type = systemdUtils.types.units;
···
visible = false;
type = types.listOf types.package;
example = literalExpression "[ pkgs.systemd-cryptsetup-generator ]";
+
description = lib.mdDoc "Packages providing systemd units and hooks.";
};
targets = mkOption {
default = {};
visible = false;
type = systemdUtils.types.initrdTargets;
+
description = lib.mdDoc "Definition of systemd target units.";
};
services = mkOption {
default = {};
type = systemdUtils.types.initrdServices;
visible = false;
+
description = lib.mdDoc "Definition of systemd service units.";
};
sockets = mkOption {
default = {};
type = systemdUtils.types.initrdSockets;
visible = false;
+
description = lib.mdDoc "Definition of systemd socket units.";
};
timers = mkOption {
default = {};
type = systemdUtils.types.initrdTimers;
visible = false;
+
description = lib.mdDoc "Definition of systemd timer units.";
};
paths = mkOption {
default = {};
type = systemdUtils.types.initrdPaths;
visible = false;
+
description = lib.mdDoc "Definition of systemd path units.";
};
mounts = mkOption {
default = [];
type = systemdUtils.types.initrdMounts;
visible = false;
+
description = lib.mdDoc ''
Definition of systemd mount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
the 'where' attribute.
···
default = [];
type = systemdUtils.types.automounts;
visible = false;
+
description = lib.mdDoc ''
Definition of systemd automount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
the 'where' attribute.
···
default = {};
type = systemdUtils.types.slices;
visible = false;
+
description = lib.mdDoc "Definition of slice configurations.";
};
};
+5 -5
nixos/modules/system/boot/tmp.nix
···
boot.cleanTmpDir = mkOption {
type = types.bool;
default = false;
-
description = ''
-
Whether to delete all files in <filename>/tmp</filename> during boot.
'';
};
boot.tmpOnTmpfs = mkOption {
type = types.bool;
default = false;
-
description = ''
-
Whether to mount a tmpfs on <filename>/tmp</filename> during boot.
'';
};
boot.tmpOnTmpfsSize = mkOption {
type = types.oneOf [ types.str types.types.ints.positive ];
default = "50%";
-
description = ''
Size of tmpfs in percentage.
Percentage is defined by systemd.
'';
···
boot.cleanTmpDir = mkOption {
type = types.bool;
default = false;
+
description = lib.mdDoc ''
+
Whether to delete all files in {file}`/tmp` during boot.
'';
};
boot.tmpOnTmpfs = mkOption {
type = types.bool;
default = false;
+
description = lib.mdDoc ''
+
Whether to mount a tmpfs on {file}`/tmp` during boot.
'';
};
boot.tmpOnTmpfsSize = mkOption {
type = types.oneOf [ types.str types.types.ints.positive ];
default = "50%";
+
description = lib.mdDoc ''
Size of tmpfs in percentage.
Percentage is defined by systemd.
'';
+15 -15
nixos/modules/system/etc/etc.nix
···
"default/useradd".text = "GROUP=100 ...";
}
'';
-
description = ''
-
Set of files that have to be linked in <filename>/etc</filename>.
'';
type = with types; attrsOf (submodule (
···
enable = mkOption {
type = types.bool;
default = true;
-
description = ''
Whether this /etc file should be generated. This
option allows specific /etc files to be disabled.
'';
···
target = mkOption {
type = types.str;
-
description = ''
Name of symlink (relative to
-
<filename>/etc</filename>). Defaults to the attribute
name.
'';
};
···
text = mkOption {
default = null;
type = types.nullOr types.lines;
-
description = "Text of the file.";
};
source = mkOption {
type = types.path;
-
description = "Path of the source file.";
};
mode = mkOption {
type = types.str;
default = "symlink";
example = "0600";
-
description = ''
-
If set to something else than <literal>symlink</literal>,
the file is copied instead of symlinked, with the given
file mode.
'';
···
uid = mkOption {
default = 0;
type = types.int;
-
description = ''
UID of created file. Only takes effect when the file is
copied (that is, the mode is not 'symlink').
'';
···
gid = mkOption {
default = 0;
type = types.int;
-
description = ''
GID of created file. Only takes effect when the file is
copied (that is, the mode is not 'symlink').
'';
···
user = mkOption {
default = "+${toString config.uid}";
type = types.str;
-
description = ''
User name of created file.
Only takes effect when the file is copied (that is, the mode is not 'symlink').
-
Changing this option takes precedence over <literal>uid</literal>.
'';
};
group = mkOption {
default = "+${toString config.gid}";
type = types.str;
-
description = ''
Group name of created file.
Only takes effect when the file is copied (that is, the mode is not 'symlink').
-
Changing this option takes precedence over <literal>gid</literal>.
'';
};
···
"default/useradd".text = "GROUP=100 ...";
}
'';
+
description = lib.mdDoc ''
+
Set of files that have to be linked in {file}`/etc`.
'';
type = with types; attrsOf (submodule (
···
enable = mkOption {
type = types.bool;
default = true;
+
description = lib.mdDoc ''
Whether this /etc file should be generated. This
option allows specific /etc files to be disabled.
'';
···
target = mkOption {
type = types.str;
+
description = lib.mdDoc ''
Name of symlink (relative to
+
{file}`/etc`). Defaults to the attribute
name.
'';
};
···
text = mkOption {
default = null;
type = types.nullOr types.lines;
+
description = lib.mdDoc "Text of the file.";
};
source = mkOption {
type = types.path;
+
description = lib.mdDoc "Path of the source file.";
};
mode = mkOption {
type = types.str;
default = "symlink";
example = "0600";
+
description = lib.mdDoc ''
+
If set to something else than `symlink`,
the file is copied instead of symlinked, with the given
file mode.
'';
···
uid = mkOption {
default = 0;
type = types.int;
+
description = lib.mdDoc ''
UID of created file. Only takes effect when the file is
copied (that is, the mode is not 'symlink').
'';
···
gid = mkOption {
default = 0;
type = types.int;
+
description = lib.mdDoc ''
GID of created file. Only takes effect when the file is
copied (that is, the mode is not 'symlink').
'';
···
user = mkOption {
default = "+${toString config.uid}";
type = types.str;
+
description = lib.mdDoc ''
User name of created file.
Only takes effect when the file is copied (that is, the mode is not 'symlink').
+
Changing this option takes precedence over `uid`.
'';
};
group = mkOption {
default = "+${toString config.gid}";
type = types.str;
+
description = lib.mdDoc ''
Group name of created file.
Only takes effect when the file is copied (that is, the mode is not 'symlink').
+
Changing this option takes precedence over `gid`.
'';
};