Skip to content

WARNING

The API is not stable yet and might be subject to change.

General

dconf.settings

Attribute set of Dconf settings. The value can be anything serializable to json, as the types are checked at runtime.

Type
plaintext
attribute set of (JSON value)
Default
nix
{ }
Example
nix
{
  "/org/gnome/desktop/interface/color-scheme" = "prefer-dark";
  "/org/gnome/desktop/interface/icon-theme" = "Adwaita";
}
Declaration

file.home

Files to symlink relative to $HOME.

You can defer some variables to be looked-up at runtime, by using mustache syntax, for example .source = "{{home}}/foo".

The variables that can be deferred with mustache syntax are the following:

{{group}} -> "$(id -gn)"
{{home}} -> "$HOME"
{{user}} -> "$USER"
{{xdg_cache_home}} -> "${XDG_CACHE_HOME:-$HOME/.cache}"
{{xdg_config_home}} -> "${XDG_CONFIG_HOME:-$HOME/.config}"
{{xdg_data_home}} -> "${XDG_DATA_HOME:-$HOME/.local/share}"
{{xdg_runtime_dir}} -> "${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
{{xdg_state_home}} -> "${XDG_STATE_HOME:-$HOME/.local/state}"
{{hash}} -> "some unique hash"
Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Example
nix
{
  "foo".source = pkgs.coreutils;
  "bar".text = "Hello";
  "baz".source = "{{home}}/.gitconfig";
}
Declaration

file.home.<name>.executable

When text is set, wether the resulting file will be executable.

Type
plaintext
boolean
Default
nix
false
Declaration

file.home.<name>.source

Path of the source file.

Type
plaintext
string or absolute path convertible to it
Declaration

file.home.<name>.target

Name of symlink, relative

Type
plaintext
string
Declaration

file.home.<name>.text

Text of the file.

Type
plaintext
null or strings concatenated with "\n"
Default
nix
null
Declaration

file.xdg_config

Files to symlink relative to $XDG_CONFIG_HOME.

You can defer some variables to be looked-up at runtime, by using mustache syntax, for example .source = "{{home}}/foo".

The variables that can be deferred with mustache syntax are the following:

{{group}} -> "$(id -gn)"
{{home}} -> "$HOME"
{{user}} -> "$USER"
{{xdg_cache_home}} -> "${XDG_CACHE_HOME:-$HOME/.cache}"
{{xdg_config_home}} -> "${XDG_CONFIG_HOME:-$HOME/.config}"
{{xdg_data_home}} -> "${XDG_DATA_HOME:-$HOME/.local/share}"
{{xdg_runtime_dir}} -> "${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
{{xdg_state_home}} -> "${XDG_STATE_HOME:-$HOME/.local/state}"
{{hash}} -> "some unique hash"
Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Example
nix
{
  "foo".source = pkgs.coreutils;
  "bar".text = "Hello";
  "baz".source = "{{home}}/.gitconfig";
}
Declaration

file.xdg_config.<name>.executable

When text is set, wether the resulting file will be executable.

Type
plaintext
boolean
Default
nix
false
Declaration

file.xdg_config.<name>.source

Path of the source file.

Type
plaintext
string or absolute path convertible to it
Declaration

file.xdg_config.<name>.target

Name of symlink, relative

Type
plaintext
string
Declaration

file.xdg_config.<name>.text

Text of the file.

Type
plaintext
null or strings concatenated with "\n"
Default
nix
null
Declaration

gsettings.settings

Attribute set of GSettings. The value can be anything serializable to json, as the types are checked at runtime.

Type
plaintext
attribute set of attribute set of (JSON value)
Default
nix
{ }
Example
nix
{
  "org.gnome.desktop.interface" = {
    color-scheme = "prefer-dark";
    icon-theme = "Adwaita";
  };
}
Declaration

maid.systemdGraphicalTarget

Default target for graphical systemd units to start.

Type
plaintext
string
Default
nix
"graphical-session.target"
Declaration

maid.systemdTarget

Default target for regular systemd units to start.

Type
plaintext
string
Default
nix
"default.target"
Declaration

packages

Extra packages to install.

Type
plaintext
list of package
Default
nix
[ ]
Example
nix
[ pkgs.git ]
Declaration

Systemd Units

systemd.enableStrictShellChecks

Whether to run shellcheck on the generated scripts for systemd units.

When enabled, all systemd scripts generated by NixOS will be checked with shellcheck and any errors or warnings will cause the build to fail.

This affects all scripts that have been created through the script, reload, preStart, postStart, preStop and postStop options for systemd services. This does not affect command lines passed directly to ExecStart, ExecReload, ExecStartPre, ExecStartPost, ExecStop or ExecStopPost.

It therefore also does not affect systemd units that are coming from packages and that are not defined through the NixOS config. This option is disabled by default, and although some services have already been fixed, it is still likely that you will encounter build failures when enabling this.

We encourage people to enable this option when they are willing and able to submit fixes for potential build failures to Nixpkgs. The option can also be enabled or disabled for individual services using the enableStrictShellChecks option on the service itself, which will take precedence over the global setting.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

systemd.globalEnvironment

Environment variables passed to all systemd units.

Type
plaintext
attribute set of (null or string or absolute path or package)
Default
nix
{ }
Example
nix
{
  TZ = "CET";
}
Declaration

systemd.package

The systemd package to use.

Type
plaintext
package
Default
nix
pkgs.systemd
Declaration

systemd.packages

Packages providing systemd units and hooks.

Type
plaintext
list of package
Default
nix
[ ]
Example
nix
[ pkgs.systemd-cryptsetup-generator ]
Declaration

systemd.paths

Definition of systemd per-user path units.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

systemd.paths.<name>.after

If the specified units are started at the same time as this unit, delay this unit until they have started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.aliases

Aliases of that unit.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.before

If the specified units are started at the same time as this unit, delay them until this unit has started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.bindsTo

Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.conflicts

If the specified units are started, then this unit is stopped and vice versa.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.description

Description of this unit used in systemd messages and progress indicators.

Type
plaintext
(optionally newline-terminated) single-line string
Default
nix
""
Declaration

systemd.paths.<name>.documentation

A list of URIs referencing documentation for this unit or its configuration.

Type
plaintext
list of string
Default
nix
[ ]
Declaration

systemd.paths.<name>.enable

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. Note that enable=true does not make a unit start by default at boot; if you want that, see wantedBy.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.paths.<name>.name

The name of this systemd unit, including its extension. This can be used to refer to this unit from other systemd units.

Type
plaintext
string
Declaration

systemd.paths.<name>.onFailure

A list of one or more units that are activated when this unit enters the "failed" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.onSuccess

A list of one or more units that are activated when this unit enters the "inactive" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.overrideStrategy

Defines how unit configuration is provided for systemd:

asDropinIfExists creates a unit file when no unit file is provided by the package otherwise it creates a drop-in file named overrides.conf.

asDropin creates a drop-in file named overrides.conf. Mainly needed to define instances for systemd template units (e.g. systemd-nspawn@mycontainer.service).

See also {manpage}systemd.unit(5).

Type
plaintext
one of "asDropinIfExists", "asDropin"
Default
nix
"asDropinIfExists"
Declaration

systemd.paths.<name>.partOf

If the specified units are stopped or restarted, then this unit is stopped or restarted as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.pathConfig

Each attribute in this set specifies an option in the [Path] section of the unit. See {manpage}systemd.path(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  PathChanged = "/some/path";
  Unit = "changedpath.service";
}
Declaration

systemd.paths.<name>.reloadTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be reloaded. If anything but a reload trigger changes in the unit file, the unit will be restarted instead.

Type
plaintext
list of (systemd option)
Default
nix
[ ]
Declaration

systemd.paths.<name>.requiredBy

Units that require (i.e. depend on and need to go down with) this unit. As discussed in the wantedBy option description this also creates .requires symlinks automatically.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.requires

Start the specified units when this unit is started, and stop this unit when the specified units are stopped or fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.requisite

Similar to requires. However if the units listed are not started, they will not be started and the transaction will fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.restartTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be restarted.

Type
plaintext
list of unspecified value
Default
nix
[ ]
Declaration

systemd.paths.<name>.startLimitBurst

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.paths.<name>.startLimitIntervalSec

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.paths.<name>.unitConfig

Each attribute in this set specifies an option in the [Unit] section of the unit. See {manpage}systemd.unit(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  RequiresMountsFor = "/data";
}
Declaration

systemd.paths.<name>.upheldBy

Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.upholds

Keeps the specified running while this unit is running. A continuous version of wants.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.wantedBy

Units that want (i.e. depend on) this unit. The default method for starting a unit by default at boot time is to set this option to ["multi-user.target"] for system services. Likewise for user units (systemd.user.<name>.*) set it to ["default.target"] to make a unit start by default when the user <name> logs on.

This option creates a .wants symlink in the given target that exists statelessly without the need for running systemctl enable. The [Install] section described in {manpage}systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.paths.<name>.wants

Start the specified units when this unit is started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services

Definition of systemd per-user service units.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

systemd.services.<name>.after

If the specified units are started at the same time as this unit, delay this unit until they have started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.aliases

Aliases of that unit.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.before

If the specified units are started at the same time as this unit, delay them until this unit has started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.bindsTo

Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.conflicts

If the specified units are started, then this unit is stopped and vice versa.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.description

Description of this unit used in systemd messages and progress indicators.

Type
plaintext
(optionally newline-terminated) single-line string
Default
nix
""
Declaration

systemd.services.<name>.documentation

A list of URIs referencing documentation for this unit or its configuration.

Type
plaintext
list of string
Default
nix
[ ]
Declaration

systemd.services.<name>.enable

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. Note that enable=true does not make a unit start by default at boot; if you want that, see wantedBy.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.services.<name>.enableStrictShellChecks

Enable running shellcheck on the generated scripts for this unit.

When enabled, scripts generated by the unit will be checked with shellcheck and any errors or warnings will cause the build to fail.

This affects all scripts that have been created through the script, reload, preStart, postStart, preStop and postStop options for systemd services. This does not affect command lines passed directly to ExecStart, ExecReload, ExecStartPre, ExecStartPost, ExecStop or ExecStopPost.

Type
plaintext
boolean
Default
nix
config.systemd.enableStrictShellChecks
Declaration

systemd.services.<name>.environment

Environment variables passed to the service's processes.

Type
plaintext
attribute set of (null or string or absolute path or package)
Default
nix
{ }
Example
nix
{
  LANG = "nl_NL.UTF-8";
  PATH = "/foo/bar/bin";
}
Declaration

systemd.services.<name>.name

The name of this systemd unit, including its extension. This can be used to refer to this unit from other systemd units.

Type
plaintext
string
Declaration

systemd.services.<name>.notSocketActivated

If set, a changed unit is never assumed to be socket-activated on configuration switch, even if it might have associated socket units. Instead, the unit will be restarted (or stopped/started) as if it had no associated sockets.

Type
plaintext
boolean
Default
nix
false
Declaration

systemd.services.<name>.onFailure

A list of one or more units that are activated when this unit enters the "failed" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.onSuccess

A list of one or more units that are activated when this unit enters the "inactive" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.overrideStrategy

Defines how unit configuration is provided for systemd:

asDropinIfExists creates a unit file when no unit file is provided by the package otherwise it creates a drop-in file named overrides.conf.

asDropin creates a drop-in file named overrides.conf. Mainly needed to define instances for systemd template units (e.g. systemd-nspawn@mycontainer.service).

See also {manpage}systemd.unit(5).

Type
plaintext
one of "asDropinIfExists", "asDropin"
Default
nix
"asDropinIfExists"
Declaration

systemd.services.<name>.partOf

If the specified units are stopped or restarted, then this unit is stopped or restarted as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.path

Packages added to the service's {env}PATH environment variable. Both the bin and {file}sbin subdirectories of each package are added.

Type
plaintext
list of (package or string)
Default
nix
[ ]
Declaration

systemd.services.<name>.postStart

Shell commands executed after the service's main process is started.

Type
plaintext
strings concatenated with "\n"
Default
nix
""
Declaration

systemd.services.<name>.postStop

Shell commands executed after the service's main process has exited.

Type
plaintext
strings concatenated with "\n"
Default
nix
""
Declaration

systemd.services.<name>.preStart

Shell commands executed before the service's main process is started.

Type
plaintext
strings concatenated with "\n"
Default
nix
""
Declaration

systemd.services.<name>.preStop

Shell commands executed to stop the service.

Type
plaintext
strings concatenated with "\n"
Default
nix
""
Declaration

systemd.services.<name>.reload

Shell commands executed when the service's main process is reloaded.

Type
plaintext
strings concatenated with "\n"
Default
nix
""
Declaration

systemd.services.<name>.reloadIfChanged

Whether the service should be reloaded during a NixOS configuration switch if its definition has changed. If enabled, the value of {option}restartIfChanged is ignored.

This option should not be used anymore in favor of {option}reloadTriggers which allows more granular control of when a service is reloaded and when a service is restarted.

Type
plaintext
boolean
Default
nix
false
Declaration

systemd.services.<name>.reloadTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be reloaded. If anything but a reload trigger changes in the unit file, the unit will be restarted instead.

Type
plaintext
list of (systemd option)
Default
nix
[ ]
Declaration

systemd.services.<name>.requiredBy

Units that require (i.e. depend on and need to go down with) this unit. As discussed in the wantedBy option description this also creates .requires symlinks automatically.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.requires

Start the specified units when this unit is started, and stop this unit when the specified units are stopped or fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.requisite

Similar to requires. However if the units listed are not started, they will not be started and the transaction will fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.restartIfChanged

Whether the service should be restarted during a NixOS configuration switch if its definition has changed.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.services.<name>.restartTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be restarted.

Type
plaintext
list of unspecified value
Default
nix
[ ]
Declaration

systemd.services.<name>.script

Shell commands executed as the service's main process.

Type
plaintext
strings concatenated with "\n"
Default
nix
""
Declaration

systemd.services.<name>.scriptArgs

Arguments passed to the main process script. Can contain specifiers (% placeholders expanded by systemd, see {manpage}systemd.unit(5)).

Type
plaintext
string
Default
nix
""
Example
nix
"%i"
Declaration

systemd.services.<name>.serviceConfig

Each attribute in this set specifies an option in the [Service] section of the unit. See {manpage}systemd.service(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  RestartSec = 5;
}
Declaration

systemd.services.<name>.startAt

Automatically start this unit at the given date/time, which must be in the format described in {manpage}systemd.time(7). This is equivalent to adding a corresponding timer unit with {option}OnCalendar set to the value given here.

Type
plaintext
string or list of string
Default
nix
[ ]
Example
nix
"Sun 14:00:00"
Declaration

systemd.services.<name>.startLimitBurst

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.services.<name>.startLimitIntervalSec

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.services.<name>.stopIfChanged

If set, a changed unit is restarted by calling systemctl stop in the old configuration, then {command}systemctl start in the new one. Otherwise, it is restarted in a single step using {command}systemctl restart in the new configuration. The latter is less correct because it runs the ExecStop commands from the new configuration.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.services.<name>.unitConfig

Each attribute in this set specifies an option in the [Unit] section of the unit. See {manpage}systemd.unit(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  RequiresMountsFor = "/data";
}
Declaration

systemd.services.<name>.upheldBy

Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.upholds

Keeps the specified running while this unit is running. A continuous version of wants.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.wantedBy

Units that want (i.e. depend on) this unit. The default method for starting a unit by default at boot time is to set this option to ["multi-user.target"] for system services. Likewise for user units (systemd.user.<name>.*) set it to ["default.target"] to make a unit start by default when the user <name> logs on.

This option creates a .wants symlink in the given target that exists statelessly without the need for running systemctl enable. The [Install] section described in {manpage}systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.services.<name>.wants

Start the specified units when this unit is started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices

Definition of systemd per-user slice units.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

systemd.slices.<name>.after

If the specified units are started at the same time as this unit, delay this unit until they have started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.aliases

Aliases of that unit.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.before

If the specified units are started at the same time as this unit, delay them until this unit has started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.bindsTo

Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.conflicts

If the specified units are started, then this unit is stopped and vice versa.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.description

Description of this unit used in systemd messages and progress indicators.

Type
plaintext
(optionally newline-terminated) single-line string
Default
nix
""
Declaration

systemd.slices.<name>.documentation

A list of URIs referencing documentation for this unit or its configuration.

Type
plaintext
list of string
Default
nix
[ ]
Declaration

systemd.slices.<name>.enable

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. Note that enable=true does not make a unit start by default at boot; if you want that, see wantedBy.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.slices.<name>.name

The name of this systemd unit, including its extension. This can be used to refer to this unit from other systemd units.

Type
plaintext
string
Declaration

systemd.slices.<name>.onFailure

A list of one or more units that are activated when this unit enters the "failed" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.onSuccess

A list of one or more units that are activated when this unit enters the "inactive" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.overrideStrategy

Defines how unit configuration is provided for systemd:

asDropinIfExists creates a unit file when no unit file is provided by the package otherwise it creates a drop-in file named overrides.conf.

asDropin creates a drop-in file named overrides.conf. Mainly needed to define instances for systemd template units (e.g. systemd-nspawn@mycontainer.service).

See also {manpage}systemd.unit(5).

Type
plaintext
one of "asDropinIfExists", "asDropin"
Default
nix
"asDropinIfExists"
Declaration

systemd.slices.<name>.partOf

If the specified units are stopped or restarted, then this unit is stopped or restarted as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.reloadTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be reloaded. If anything but a reload trigger changes in the unit file, the unit will be restarted instead.

Type
plaintext
list of (systemd option)
Default
nix
[ ]
Declaration

systemd.slices.<name>.requiredBy

Units that require (i.e. depend on and need to go down with) this unit. As discussed in the wantedBy option description this also creates .requires symlinks automatically.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.requires

Start the specified units when this unit is started, and stop this unit when the specified units are stopped or fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.requisite

Similar to requires. However if the units listed are not started, they will not be started and the transaction will fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.restartTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be restarted.

Type
plaintext
list of unspecified value
Default
nix
[ ]
Declaration

systemd.slices.<name>.sliceConfig

Each attribute in this set specifies an option in the [Slice] section of the unit. See {manpage}systemd.slice(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  MemoryMax = "2G";
}
Declaration

systemd.slices.<name>.startLimitBurst

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.slices.<name>.startLimitIntervalSec

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.slices.<name>.unitConfig

Each attribute in this set specifies an option in the [Unit] section of the unit. See {manpage}systemd.unit(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  RequiresMountsFor = "/data";
}
Declaration

systemd.slices.<name>.upheldBy

Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.upholds

Keeps the specified running while this unit is running. A continuous version of wants.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.wantedBy

Units that want (i.e. depend on) this unit. The default method for starting a unit by default at boot time is to set this option to ["multi-user.target"] for system services. Likewise for user units (systemd.user.<name>.*) set it to ["default.target"] to make a unit start by default when the user <name> logs on.

This option creates a .wants symlink in the given target that exists statelessly without the need for running systemctl enable. The [Install] section described in {manpage}systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.slices.<name>.wants

Start the specified units when this unit is started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets

Definition of systemd per-user socket units.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

systemd.sockets.<name>.after

If the specified units are started at the same time as this unit, delay this unit until they have started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.aliases

Aliases of that unit.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.before

If the specified units are started at the same time as this unit, delay them until this unit has started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.bindsTo

Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.conflicts

If the specified units are started, then this unit is stopped and vice versa.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.description

Description of this unit used in systemd messages and progress indicators.

Type
plaintext
(optionally newline-terminated) single-line string
Default
nix
""
Declaration

systemd.sockets.<name>.documentation

A list of URIs referencing documentation for this unit or its configuration.

Type
plaintext
list of string
Default
nix
[ ]
Declaration

systemd.sockets.<name>.enable

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. Note that enable=true does not make a unit start by default at boot; if you want that, see wantedBy.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.sockets.<name>.listenDatagrams

For each item in this list, a ListenDatagram option in the [Socket] section will be created.

Type
plaintext
list of string
Default
nix
[ ]
Example
nix
[
  "0.0.0.0:993"
  "/run/my-socket"
]
Declaration

systemd.sockets.<name>.listenStreams

For each item in this list, a ListenStream option in the [Socket] section will be created.

Type
plaintext
list of string
Default
nix
[ ]
Example
nix
[
  "0.0.0.0:993"
  "/run/my-socket"
]
Declaration

systemd.sockets.<name>.name

The name of this systemd unit, including its extension. This can be used to refer to this unit from other systemd units.

Type
plaintext
string
Declaration

systemd.sockets.<name>.onFailure

A list of one or more units that are activated when this unit enters the "failed" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.onSuccess

A list of one or more units that are activated when this unit enters the "inactive" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.overrideStrategy

Defines how unit configuration is provided for systemd:

asDropinIfExists creates a unit file when no unit file is provided by the package otherwise it creates a drop-in file named overrides.conf.

asDropin creates a drop-in file named overrides.conf. Mainly needed to define instances for systemd template units (e.g. systemd-nspawn@mycontainer.service).

See also {manpage}systemd.unit(5).

Type
plaintext
one of "asDropinIfExists", "asDropin"
Default
nix
"asDropinIfExists"
Declaration

systemd.sockets.<name>.partOf

If the specified units are stopped or restarted, then this unit is stopped or restarted as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.reloadTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be reloaded. If anything but a reload trigger changes in the unit file, the unit will be restarted instead.

Type
plaintext
list of (systemd option)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.requiredBy

Units that require (i.e. depend on and need to go down with) this unit. As discussed in the wantedBy option description this also creates .requires symlinks automatically.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.requires

Start the specified units when this unit is started, and stop this unit when the specified units are stopped or fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.requisite

Similar to requires. However if the units listed are not started, they will not be started and the transaction will fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.restartTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be restarted.

Type
plaintext
list of unspecified value
Default
nix
[ ]
Declaration

systemd.sockets.<name>.socketConfig

Each attribute in this set specifies an option in the [Socket] section of the unit. See {manpage}systemd.socket(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  ListenStream = "/run/my-socket";
}
Declaration

systemd.sockets.<name>.startLimitBurst

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.sockets.<name>.startLimitIntervalSec

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.sockets.<name>.unitConfig

Each attribute in this set specifies an option in the [Unit] section of the unit. See {manpage}systemd.unit(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  RequiresMountsFor = "/data";
}
Declaration

systemd.sockets.<name>.upheldBy

Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.upholds

Keeps the specified running while this unit is running. A continuous version of wants.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.wantedBy

Units that want (i.e. depend on) this unit. The default method for starting a unit by default at boot time is to set this option to ["multi-user.target"] for system services. Likewise for user units (systemd.user.<name>.*) set it to ["default.target"] to make a unit start by default when the user <name> logs on.

This option creates a .wants symlink in the given target that exists statelessly without the need for running systemctl enable. The [Install] section described in {manpage}systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.sockets.<name>.wants

Start the specified units when this unit is started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets

Definition of systemd per-user target units.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

systemd.targets.<name>.after

If the specified units are started at the same time as this unit, delay this unit until they have started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.aliases

Aliases of that unit.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.before

If the specified units are started at the same time as this unit, delay them until this unit has started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.bindsTo

Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.conflicts

If the specified units are started, then this unit is stopped and vice versa.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.description

Description of this unit used in systemd messages and progress indicators.

Type
plaintext
(optionally newline-terminated) single-line string
Default
nix
""
Declaration

systemd.targets.<name>.documentation

A list of URIs referencing documentation for this unit or its configuration.

Type
plaintext
list of string
Default
nix
[ ]
Declaration

systemd.targets.<name>.enable

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. Note that enable=true does not make a unit start by default at boot; if you want that, see wantedBy.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.targets.<name>.name

The name of this systemd unit, including its extension. This can be used to refer to this unit from other systemd units.

Type
plaintext
string
Declaration

systemd.targets.<name>.onFailure

A list of one or more units that are activated when this unit enters the "failed" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.onSuccess

A list of one or more units that are activated when this unit enters the "inactive" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.overrideStrategy

Defines how unit configuration is provided for systemd:

asDropinIfExists creates a unit file when no unit file is provided by the package otherwise it creates a drop-in file named overrides.conf.

asDropin creates a drop-in file named overrides.conf. Mainly needed to define instances for systemd template units (e.g. systemd-nspawn@mycontainer.service).

See also {manpage}systemd.unit(5).

Type
plaintext
one of "asDropinIfExists", "asDropin"
Default
nix
"asDropinIfExists"
Declaration

systemd.targets.<name>.partOf

If the specified units are stopped or restarted, then this unit is stopped or restarted as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.reloadTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be reloaded. If anything but a reload trigger changes in the unit file, the unit will be restarted instead.

Type
plaintext
list of (systemd option)
Default
nix
[ ]
Declaration

systemd.targets.<name>.requiredBy

Units that require (i.e. depend on and need to go down with) this unit. As discussed in the wantedBy option description this also creates .requires symlinks automatically.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.requires

Start the specified units when this unit is started, and stop this unit when the specified units are stopped or fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.requisite

Similar to requires. However if the units listed are not started, they will not be started and the transaction will fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.restartTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be restarted.

Type
plaintext
list of unspecified value
Default
nix
[ ]
Declaration

systemd.targets.<name>.startLimitBurst

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.targets.<name>.startLimitIntervalSec

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.targets.<name>.unitConfig

Each attribute in this set specifies an option in the [Unit] section of the unit. See {manpage}systemd.unit(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  RequiresMountsFor = "/data";
}
Declaration

systemd.targets.<name>.upheldBy

Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.upholds

Keeps the specified running while this unit is running. A continuous version of wants.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.wantedBy

Units that want (i.e. depend on) this unit. The default method for starting a unit by default at boot time is to set this option to ["multi-user.target"] for system services. Likewise for user units (systemd.user.<name>.*) set it to ["default.target"] to make a unit start by default when the user <name> logs on.

This option creates a .wants symlink in the given target that exists statelessly without the need for running systemctl enable. The [Install] section described in {manpage}systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.targets.<name>.wants

Start the specified units when this unit is started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers

Definition of systemd per-user timer units.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

systemd.timers.<name>.after

If the specified units are started at the same time as this unit, delay this unit until they have started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.aliases

Aliases of that unit.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.before

If the specified units are started at the same time as this unit, delay them until this unit has started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.bindsTo

Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.conflicts

If the specified units are started, then this unit is stopped and vice versa.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.description

Description of this unit used in systemd messages and progress indicators.

Type
plaintext
(optionally newline-terminated) single-line string
Default
nix
""
Declaration

systemd.timers.<name>.documentation

A list of URIs referencing documentation for this unit or its configuration.

Type
plaintext
list of string
Default
nix
[ ]
Declaration

systemd.timers.<name>.enable

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. Note that enable=true does not make a unit start by default at boot; if you want that, see wantedBy.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.timers.<name>.name

The name of this systemd unit, including its extension. This can be used to refer to this unit from other systemd units.

Type
plaintext
string
Declaration

systemd.timers.<name>.onFailure

A list of one or more units that are activated when this unit enters the "failed" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.onSuccess

A list of one or more units that are activated when this unit enters the "inactive" state.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.overrideStrategy

Defines how unit configuration is provided for systemd:

asDropinIfExists creates a unit file when no unit file is provided by the package otherwise it creates a drop-in file named overrides.conf.

asDropin creates a drop-in file named overrides.conf. Mainly needed to define instances for systemd template units (e.g. systemd-nspawn@mycontainer.service).

See also {manpage}systemd.unit(5).

Type
plaintext
one of "asDropinIfExists", "asDropin"
Default
nix
"asDropinIfExists"
Declaration

systemd.timers.<name>.partOf

If the specified units are stopped or restarted, then this unit is stopped or restarted as well.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.reloadTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be reloaded. If anything but a reload trigger changes in the unit file, the unit will be restarted instead.

Type
plaintext
list of (systemd option)
Default
nix
[ ]
Declaration

systemd.timers.<name>.requiredBy

Units that require (i.e. depend on and need to go down with) this unit. As discussed in the wantedBy option description this also creates .requires symlinks automatically.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.requires

Start the specified units when this unit is started, and stop this unit when the specified units are stopped or fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.requisite

Similar to requires. However if the units listed are not started, they will not be started and the transaction will fail.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.restartTriggers

An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will be restarted.

Type
plaintext
list of unspecified value
Default
nix
[ ]
Declaration

systemd.timers.<name>.startLimitBurst

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.timers.<name>.startLimitIntervalSec

Configure unit start rate limiting. Units which are started more than startLimitBurst times within an interval time interval are not permitted to start any more.

Type
plaintext
signed integer
Declaration

systemd.timers.<name>.timerConfig

Each attribute in this set specifies an option in the [Timer] section of the unit. See {manpage}systemd.timer(5) and {manpage}systemd.time(7) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  OnCalendar = "Sun 14:00:00";
  Unit = "foo.service";
}
Declaration

systemd.timers.<name>.unitConfig

Each attribute in this set specifies an option in the [Unit] section of the unit. See {manpage}systemd.unit(5) for details.

Type
plaintext
attribute set of (systemd option)
Default
nix
{ }
Example
nix
{
  RequiresMountsFor = "/data";
}
Declaration

systemd.timers.<name>.upheldBy

Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.upholds

Keeps the specified running while this unit is running. A continuous version of wants.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.wantedBy

Units that want (i.e. depend on) this unit. The default method for starting a unit by default at boot time is to set this option to ["multi-user.target"] for system services. Likewise for user units (systemd.user.<name>.*) set it to ["default.target"] to make a unit start by default when the user <name> logs on.

This option creates a .wants symlink in the given target that exists statelessly without the need for running systemctl enable. The [Install] section described in {manpage}systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.timers.<name>.wants

Start the specified units when this unit is started.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.tmpfiles.dynamicRules

Like tmpfiles.rules, but accepts mustache templates that will be rendered at activation time.

The variables that can be deferred with mustache syntax are the following:

{{group}} -> "$(id -gn)"
{{home}} -> "$HOME"
{{user}} -> "$USER"
{{xdg_cache_home}} -> "${XDG_CACHE_HOME:-$HOME/.cache}"
{{xdg_config_home}} -> "${XDG_CONFIG_HOME:-$HOME/.config}"
{{xdg_data_home}} -> "${XDG_DATA_HOME:-$HOME/.local/share}"
{{xdg_runtime_dir}} -> "${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
{{xdg_state_home}} -> "${XDG_STATE_HOME:-$HOME/.local/state}"
{{hash}} -> "some unique hash"
Type
plaintext
list of string
Default
nix
[ ]
Example
nix
[
  "f {{xdg_runtime_dir}}/test 0644 {{user}} {{group}} - -"
]
Declaration

systemd.tmpfiles.rules

Global user rules for creation, deletion and cleaning of volatile and temporary files automatically. See {manpage}tmpfiles.d(5) for the exact format.

Type
plaintext
list of string
Default
nix
[ ]
Example
nix
[
  "D %C - - - 7d"
]
Declaration

systemd.units

Definition of systemd per-user units.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

systemd.units.<name>.aliases

Aliases of that unit.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.units.<name>.enable

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. Note that enable=true does not make a unit start by default at boot; if you want that, see wantedBy.

Type
plaintext
boolean
Default
nix
true
Declaration

systemd.units.<name>.name

The name of this systemd unit, including its extension. This can be used to refer to this unit from other systemd units.

Type
plaintext
string
Declaration

systemd.units.<name>.overrideStrategy

Defines how unit configuration is provided for systemd:

asDropinIfExists creates a unit file when no unit file is provided by the package otherwise it creates a drop-in file named overrides.conf.

asDropin creates a drop-in file named overrides.conf. Mainly needed to define instances for systemd template units (e.g. systemd-nspawn@mycontainer.service).

See also {manpage}systemd.unit(5).

Type
plaintext
one of "asDropinIfExists", "asDropin"
Default
nix
"asDropinIfExists"
Declaration

systemd.units.<name>.requiredBy

Units that require (i.e. depend on and need to go down with) this unit. As discussed in the wantedBy option description this also creates .requires symlinks automatically.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.units.<name>.text

Text of this systemd unit.

Type
plaintext
null or string
Default
nix
null
Declaration

systemd.units.<name>.upheldBy

Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration

systemd.units.<name>.wantedBy

Units that want (i.e. depend on) this unit. The default method for starting a unit by default at boot time is to set this option to ["multi-user.target"] for system services. Likewise for user units (systemd.user.<name>.*) set it to ["default.target"] to make a unit start by default when the user <name> logs on.

This option creates a .wants symlink in the given target that exists statelessly without the need for running systemctl enable. The [Install] section described in {manpage}systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
plaintext
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
nix
[ ]
Declaration