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.
attribute set of (JSON value)
{ }
{
"/org/gnome/desktop/interface/color-scheme" = "prefer-dark";
"/org/gnome/desktop/interface/icon-theme" = "Adwaita";
}
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"
attribute set of (submodule)
{ }
{
"foo".source = pkgs.coreutils;
"bar".text = "Hello";
"baz".source = "{{home}}/.gitconfig";
}
file.home.<name>.executable
When text is set, wether the resulting file will be executable.
file.home.<name>.source
Path of the source file.
string or absolute path convertible to it
file.home.<name>.target
Name of symlink, relative
file.home.<name>.text
Text of the file.
null or strings concatenated with "\n"
null
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"
attribute set of (submodule)
{ }
{
"foo".source = pkgs.coreutils;
"bar".text = "Hello";
"baz".source = "{{home}}/.gitconfig";
}
file.xdg_config.<name>.executable
When text is set, wether the resulting file will be executable.
file.xdg_config.<name>.source
Path of the source file.
string or absolute path convertible to it
file.xdg_config.<name>.target
Name of symlink, relative
file.xdg_config.<name>.text
Text of the file.
null or strings concatenated with "\n"
null
gsettings.settings
Attribute set of GSettings. The value can be anything serializable to json, as the types are checked at runtime.
attribute set of attribute set of (JSON value)
{ }
{
"org.gnome.desktop.interface" = {
color-scheme = "prefer-dark";
icon-theme = "Adwaita";
};
}
maid.systemdGraphicalTarget
Default target for graphical systemd units to start.
string
"graphical-session.target"
maid.systemdTarget
Default target for regular systemd units to start.
packages
Extra packages to install.
list of package
[ ]
[ pkgs.git ]
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.
systemd.globalEnvironment
Environment variables passed to all systemd units.
attribute set of (null or string or absolute path or package)
{ }
{
TZ = "CET";
}
systemd.package
The systemd package to use.
systemd.packages
Packages providing systemd units and hooks.
list of package
[ ]
[ pkgs.systemd-cryptsetup-generator ]
systemd.paths
Definition of systemd per-user path units.
attribute set of (submodule)
{ }
systemd.paths.<name>.after
If the specified units are started at the same time as this unit, delay this unit until they have started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.paths.<name>.aliases
Aliases of that unit.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.paths.<name>.before
If the specified units are started at the same time as this unit, delay them until this unit has started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.paths.<name>.bindsTo
Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.paths.<name>.conflicts
If the specified units are started, then this unit is stopped and vice versa.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.paths.<name>.description
Description of this unit used in systemd messages and progress indicators.
(optionally newline-terminated) single-line string
""
systemd.paths.<name>.documentation
A list of URIs referencing documentation for this unit or its configuration.
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
.
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.
systemd.paths.<name>.onFailure
A list of one or more units that are activated when this unit enters the "failed" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.paths.<name>.onSuccess
A list of one or more units that are activated when this unit enters the "inactive" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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)
.
one of "asDropinIfExists", "asDropin"
"asDropinIfExists"
systemd.paths.<name>.partOf
If the specified units are stopped or restarted, then this unit is stopped or restarted as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
attribute set of (systemd option)
{ }
{
PathChanged = "/some/path";
Unit = "changedpath.service";
}
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.
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of unspecified value
[ ]
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.
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.
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.
attribute set of (systemd option)
{ }
{
RequiresMountsFor = "/data";
}
systemd.paths.<name>.upheldBy
Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.paths.<name>.upholds
Keeps the specified running while this unit is running. A continuous version of wants
.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.paths.<name>.wants
Start the specified units when this unit is started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services
Definition of systemd per-user service units.
attribute set of (submodule)
{ }
systemd.services.<name>.after
If the specified units are started at the same time as this unit, delay this unit until they have started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.aliases
Aliases of that unit.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.before
If the specified units are started at the same time as this unit, delay them until this unit has started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.bindsTo
Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.conflicts
If the specified units are started, then this unit is stopped and vice versa.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.description
Description of this unit used in systemd messages and progress indicators.
(optionally newline-terminated) single-line string
""
systemd.services.<name>.documentation
A list of URIs referencing documentation for this unit or its configuration.
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
.
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
.
boolean
config.systemd.enableStrictShellChecks
systemd.services.<name>.environment
Environment variables passed to the service's processes.
attribute set of (null or string or absolute path or package)
{ }
{
LANG = "nl_NL.UTF-8";
PATH = "/foo/bar/bin";
}
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.
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.
systemd.services.<name>.onFailure
A list of one or more units that are activated when this unit enters the "failed" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.onSuccess
A list of one or more units that are activated when this unit enters the "inactive" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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)
.
one of "asDropinIfExists", "asDropin"
"asDropinIfExists"
systemd.services.<name>.partOf
If the specified units are stopped or restarted, then this unit is stopped or restarted as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of (package or string)
[ ]
systemd.services.<name>.postStart
Shell commands executed after the service's main process is started.
strings concatenated with "\n"
""
systemd.services.<name>.postStop
Shell commands executed after the service's main process has exited.
strings concatenated with "\n"
""
systemd.services.<name>.preStart
Shell commands executed before the service's main process is started.
strings concatenated with "\n"
""
systemd.services.<name>.preStop
Shell commands executed to stop the service.
strings concatenated with "\n"
""
systemd.services.<name>.reload
Shell commands executed when the service's main process is reloaded.
strings concatenated with "\n"
""
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.
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.
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.restartIfChanged
Whether the service should be restarted during a NixOS configuration switch if its definition has changed.
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.
list of unspecified value
[ ]
systemd.services.<name>.script
Shell commands executed as the service's main process.
strings concatenated with "\n"
""
systemd.services.<name>.scriptArgs
Arguments passed to the main process script.
Can contain specifiers (%
placeholders expanded by systemd, see {manpage}systemd.unit(5)
).
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.
attribute set of (systemd option)
{ }
{
RestartSec = 5;
}
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.
string or list of string
[ ]
"Sun 14:00:00"
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.
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.
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.
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.
attribute set of (systemd option)
{ }
{
RequiresMountsFor = "/data";
}
systemd.services.<name>.upheldBy
Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.upholds
Keeps the specified running while this unit is running. A continuous version of wants
.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.services.<name>.wants
Start the specified units when this unit is started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices
Definition of systemd per-user slice units.
attribute set of (submodule)
{ }
systemd.slices.<name>.after
If the specified units are started at the same time as this unit, delay this unit until they have started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices.<name>.aliases
Aliases of that unit.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices.<name>.before
If the specified units are started at the same time as this unit, delay them until this unit has started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices.<name>.bindsTo
Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices.<name>.conflicts
If the specified units are started, then this unit is stopped and vice versa.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices.<name>.description
Description of this unit used in systemd messages and progress indicators.
(optionally newline-terminated) single-line string
""
systemd.slices.<name>.documentation
A list of URIs referencing documentation for this unit or its configuration.
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
.
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.
systemd.slices.<name>.onFailure
A list of one or more units that are activated when this unit enters the "failed" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices.<name>.onSuccess
A list of one or more units that are activated when this unit enters the "inactive" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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)
.
one of "asDropinIfExists", "asDropin"
"asDropinIfExists"
systemd.slices.<name>.partOf
If the specified units are stopped or restarted, then this unit is stopped or restarted as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of unspecified value
[ ]
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.
attribute set of (systemd option)
{ }
{
MemoryMax = "2G";
}
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.
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.
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.
attribute set of (systemd option)
{ }
{
RequiresMountsFor = "/data";
}
systemd.slices.<name>.upheldBy
Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices.<name>.upholds
Keeps the specified running while this unit is running. A continuous version of wants
.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.slices.<name>.wants
Start the specified units when this unit is started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets
Definition of systemd per-user socket units.
attribute set of (submodule)
{ }
systemd.sockets.<name>.after
If the specified units are started at the same time as this unit, delay this unit until they have started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets.<name>.aliases
Aliases of that unit.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets.<name>.before
If the specified units are started at the same time as this unit, delay them until this unit has started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets.<name>.bindsTo
Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets.<name>.conflicts
If the specified units are started, then this unit is stopped and vice versa.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets.<name>.description
Description of this unit used in systemd messages and progress indicators.
(optionally newline-terminated) single-line string
""
systemd.sockets.<name>.documentation
A list of URIs referencing documentation for this unit or its configuration.
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
.
systemd.sockets.<name>.listenDatagrams
For each item in this list, a ListenDatagram
option in the [Socket]
section will be created.
list of string
[ ]
[
"0.0.0.0:993"
"/run/my-socket"
]
systemd.sockets.<name>.listenStreams
For each item in this list, a ListenStream
option in the [Socket]
section will be created.
list of string
[ ]
[
"0.0.0.0:993"
"/run/my-socket"
]
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.
systemd.sockets.<name>.onFailure
A list of one or more units that are activated when this unit enters the "failed" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets.<name>.onSuccess
A list of one or more units that are activated when this unit enters the "inactive" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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)
.
one of "asDropinIfExists", "asDropin"
"asDropinIfExists"
systemd.sockets.<name>.partOf
If the specified units are stopped or restarted, then this unit is stopped or restarted as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of unspecified value
[ ]
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.
attribute set of (systemd option)
{ }
{
ListenStream = "/run/my-socket";
}
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.
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.
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.
attribute set of (systemd option)
{ }
{
RequiresMountsFor = "/data";
}
systemd.sockets.<name>.upheldBy
Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets.<name>.upholds
Keeps the specified running while this unit is running. A continuous version of wants
.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.sockets.<name>.wants
Start the specified units when this unit is started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets
Definition of systemd per-user target units.
attribute set of (submodule)
{ }
systemd.targets.<name>.after
If the specified units are started at the same time as this unit, delay this unit until they have started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets.<name>.aliases
Aliases of that unit.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets.<name>.before
If the specified units are started at the same time as this unit, delay them until this unit has started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets.<name>.bindsTo
Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets.<name>.conflicts
If the specified units are started, then this unit is stopped and vice versa.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets.<name>.description
Description of this unit used in systemd messages and progress indicators.
(optionally newline-terminated) single-line string
""
systemd.targets.<name>.documentation
A list of URIs referencing documentation for this unit or its configuration.
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
.
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.
systemd.targets.<name>.onFailure
A list of one or more units that are activated when this unit enters the "failed" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets.<name>.onSuccess
A list of one or more units that are activated when this unit enters the "inactive" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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)
.
one of "asDropinIfExists", "asDropin"
"asDropinIfExists"
systemd.targets.<name>.partOf
If the specified units are stopped or restarted, then this unit is stopped or restarted as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of unspecified value
[ ]
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.
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.
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.
attribute set of (systemd option)
{ }
{
RequiresMountsFor = "/data";
}
systemd.targets.<name>.upheldBy
Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets.<name>.upholds
Keeps the specified running while this unit is running. A continuous version of wants
.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.targets.<name>.wants
Start the specified units when this unit is started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers
Definition of systemd per-user timer units.
attribute set of (submodule)
{ }
systemd.timers.<name>.after
If the specified units are started at the same time as this unit, delay this unit until they have started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers.<name>.aliases
Aliases of that unit.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers.<name>.before
If the specified units are started at the same time as this unit, delay them until this unit has started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers.<name>.bindsTo
Like ‘requires’, but in addition, if the specified units unexpectedly disappear, this unit will be stopped as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers.<name>.conflicts
If the specified units are started, then this unit is stopped and vice versa.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers.<name>.description
Description of this unit used in systemd messages and progress indicators.
(optionally newline-terminated) single-line string
""
systemd.timers.<name>.documentation
A list of URIs referencing documentation for this unit or its configuration.
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
.
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.
systemd.timers.<name>.onFailure
A list of one or more units that are activated when this unit enters the "failed" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers.<name>.onSuccess
A list of one or more units that are activated when this unit enters the "inactive" state.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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)
.
one of "asDropinIfExists", "asDropin"
"asDropinIfExists"
systemd.timers.<name>.partOf
If the specified units are stopped or restarted, then this unit is stopped or restarted as well.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of unspecified value
[ ]
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.
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.
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.
attribute set of (systemd option)
{ }
{
OnCalendar = "Sun 14:00:00";
Unit = "foo.service";
}
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.
attribute set of (systemd option)
{ }
{
RequiresMountsFor = "/data";
}
systemd.timers.<name>.upheldBy
Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers.<name>.upholds
Keeps the specified running while this unit is running. A continuous version of wants
.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.timers.<name>.wants
Start the specified units when this unit is started.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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"
list of string
[ ]
[
"f {{xdg_runtime_dir}}/test 0644 {{user}} {{group}} - -"
]
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.
list of string
[ ]
[
"D %C - - - 7d"
]
systemd.units
Definition of systemd per-user units.
attribute set of (submodule)
{ }
systemd.units.<name>.aliases
Aliases of that unit.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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
.
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.
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)
.
one of "asDropinIfExists", "asDropin"
"asDropinIfExists"
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
systemd.units.<name>.text
Text of this systemd unit.
systemd.units.<name>.upheldBy
Keep this unit running as long as the listed units are running. This is a continuously enforced version of wantedBy.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]
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.
list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
[ ]