diff --git a/nixos/modules/system/boot/systemd-unit-options.nix b/nixos/modules/system/boot/systemd-unit-options.nix
index 9be10a8283e..43a9c28bb69 100644
--- a/nixos/modules/system/boot/systemd-unit-options.nix
+++ b/nixos/modules/system/boot/systemd-unit-options.nix
@@ -35,21 +35,40 @@ in rec {
description = ''
If set to false, this unit will be a symlink to
/dev/null. This is primarily useful to prevent specific
- template instances (e.g. serial-getty@ttyS0)
- from being started.
+ template instances
+ (e.g. serial-getty@ttyS0) from being
+ started. Note that enable=true does not
+ make a unit start by default at boot; if you want that, see
+ wantedBy.
'';
};
requiredBy = mkOption {
default = [];
type = types.listOf types.str;
- description = "Units that require (i.e. depend on and need to go down with) this unit.";
+ description = ''
+ Units that require (i.e. depend on and need to go down with)
+ this unit. The discussion under wantedBy
+ applies here as well: inverse .requires
+ symlinks are established.
+ '';
};
wantedBy = mkOption {
default = [];
type = types.listOf types.str;
- description = "Units that want (i.e. depend on) this unit.";
+ description = ''
+ Units that want (i.e. depend on) this unit. The standard way
+ to make a unit start by default at boot is to set this option
+ to [ "multi-user.target" ]. That's despite
+ the fact that the systemd.unit(5) manpage says this option
+ goes in the [Install] section that controls
+ the behaviour of systemctl enable. Since
+ such a process is stateful and thus contrary to the design of
+ NixOS, setting this option instead causes the equivalent
+ inverse .wants symlink to be present,
+ establishing the same desired relationship in a stateless way.
+ '';
};
aliases = mkOption {