Hjem Options

/ to filter ↑ ↓ to browse Esc to return to the filter

hjem.cli.package Link copied!

The Hjem CLI package to use.

Type
package
Default
pkgs.callPackage ../../cli/package.nix { }
Declared in
<hjem/modules/common/top-level.nix>

hjem.clobberByDefault Link copied!

The default override behaviour for files managed by Hjem.

While true, existing files will be overriden with new files on rebuild. The behaviour may be modified per-user by setting hjem.users.<username>.clobberFiles to the desired value.

Type
boolean
Default
false
Declared in
<hjem/modules/common/top-level.nix>

hjem.extraModules Link copied!

Additional modules to be evaluated as a part of the users module inside config.hjem.users.<username>. This can be used to extend each user configuration with additional options.

Type
list of module
Default
[ ]
Declared in
<hjem/modules/common/top-level.nix>

hjem.linker Link copied!

Package to use to link files.

By default, Hjem uses its own standalone CLI linker.

Setting this to null will use systemd-tmpfiles, which is only supported on Linux.

Specifying a non-null package uses an external linker that is invoked with Hjem-managed manifests.

Type
null or package
Default
config.hjem.cli.package
Declared in
<hjem/modules/common/top-level.nix>

hjem.linkerOptions Link copied!

Additional linker configuration.

When using Hjem's built-in standalone linker, only prefix is consumed from an attribute set.

Note

When using an external linker package, list values are forwarded as linker arguments and attribute-set values are forwarded as --linker-opts <json-file>.

Type
(list of (optionally newline-terminated) single-line string) or (attribute set)
Default
[ ]
Declared in
<hjem/modules/common/top-level.nix>

hjem.specialArgs Link copied!

Additional specialArgs are passed to Hjem, allowing extra arguments to be passed down to to all imported modules.

Type
attribute set
Default
{ }
Example
{ inherit inputs; }
Declared in
<hjem/modules/common/top-level.nix>

hjem.users Link copied!

Hjem-managed user configurations.

Type
attribute set of (Hjem submodule for NixOS)
Default
{ }
Declared in
<hjem/modules/common/top-level.nix>

hjem.users.<username>.enable Link copied!

Whether to enable home management for this user.

Type
boolean
Default
true
Example
false
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.packages Link copied!

Packages to install for this user.

Type
list of package
Default
[ ]
Example
[pkgs.hello]
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.clobberFiles Link copied!

The default override behaviour for files managed by Hjem for a particular user.

A top level option exists under the Hjem module option hjem.clobberByDefault. Per-file behaviour can be modified with hjem.users.<username>.files.<path>.clobber.

Type
boolean
Example
true
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.directory Link copied!

The home directory for the user, to which files configured in hjem.users.<username>.files will be relative to by default.

Type
absolute path, not containing newlines or colons
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.environment.loadEnv Link copied!

A POSIX compliant shell script containing the user session variables needed to bootstrap the session.

As there is no reliable and agnostic way of setting session variables, Hjem's environment module does nothing by itself. Rather, it provides a POSIX compliant shell script that needs to be sourced where needed.

Type
absolute path
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.environment.sessionVariables Link copied!

A set of environment variables used in the user environment. If a list of strings is used, they will be concatenated with colon characters.

Type
attribute set of (null or (list of (signed integer or string or absolute path)) or signed integer or string or absolute path)
Default
{ }
Example
{
  EDITOR = "nvim";
  VISUAL = "nvim";
}
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.extraDependencies Link copied!

A list of paths/packages that should be included in the system closure but generally not visible to users.

On NixOS these paths are forwarded to system.extraDependencies. On nix-darwin, which has no equivalent host option, the paths are pinned to the system closure by listing them in /etc/hjem/extra-dependencies.

Type
list of package
Default
[ ]
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files Link copied!

Hjem-managed files.

Type
attribute set of (submodule)
Default
{ }
Example
{
  ".config/foo.txt" = {
    source = "Hello World";
  };
}
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.enable Link copied!

Whether to enable creation of this file.

Type
boolean
Default
true
Example
false
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.clobber Link copied!

Whether to "clobber" existing target paths.

  • If using the systemd-tmpfiles hook (Linux only), tmpfile rules will be constructed with L+ (recreate) instead of L (create) type while this is set to true.
Type
boolean
Default
config.hjem.users.‹username›.clobberFiles
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.executable Link copied!

Whether to set the execute bit on the target file.

Type
boolean
Default
false
Example
true
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.generator Link copied!

Function that when applied to value will create the source or text of the file.

Detection is automatic, as we check if the generator generates a derivation or a string after applying to value.

Type
null or (function that evaluates to a(n) (null or absolute path or null or strings concatenated with "\n"))
Default
null
Example
lib.generators.toGitINI
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.gid Link copied!

Group ID to set as owner on the target path.

Type
null or 32 bit unsigned integer; between 0 and 4294967295 (both inclusive)
Default
null
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.permissions Link copied!

Permissions (in octal) to set on the target path.

Type
null or string
Default
null
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.source Link copied!

Path of the source file or directory.

Type
null or absolute path
Default
null
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.target Link copied!

Path to target file relative to /home/‹username›.

Type
string
Default
‹path›
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.text Link copied!

Text of the file.

Type
null or strings concatenated with "\n"
Default
null
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.type Link copied!

Type of path to create.

Type
one of "symlink", "copy", "delete", "directory", "modify"
Default
"symlink"
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.uid Link copied!

User ID to set as owner on the target path.

Type
null or 32 bit unsigned integer; between 0 and 4294967295 (both inclusive)
Default
null
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.files.<path>.value Link copied!

Value passed to the generator.

Type
null or (attribute set of anything)
Default
null
Example
{
  user = {
    email = "me@example.com";
  };
}
Declared in
<hjem/modules/common/user.nix>

hjem.users.<username>.systemd.enable Link copied!

Whether to enable Hjem management of systemd units.

Type
boolean
Default
true
Example
false
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.packages Link copied!

Packages containing systemd user unit files to be linked into ~/.config/systemd/user/. Unit files are taken from $pkg/etc/systemd/user/ and $pkg/lib/systemd/user/.

Units declared in systemd.services and friends take precedence over package-provided units with the same name.

Type
list of package
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths Link copied!

Definition of systemd per-user path units.

Type
attribute set of (submodule)
Default
{ }
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.enable Link copied!

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
boolean
Default
true
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.after Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.aliases Link copied!

Aliases of that unit.

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.before Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.bindsTo Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.conflicts Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.description Link copied!

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

Type
(optionally newline-terminated) single-line string
Default
""
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.documentation Link copied!

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

Type
list of string
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.name Link copied!

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

Type
string
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.onFailure Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.onSuccess Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.overrideStrategy Link copied!

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 systemd.unit(5).

Type
one of "asDropinIfExists", "asDropin"
Default
"asDropinIfExists"
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.partOf Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.pathConfig Link copied!

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

Type
attribute set of (systemd option)
Default
{ }
Example
{
  PathChanged = "/some/path";
  Unit = "changedpath.service";
}
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.reloadTriggers Link copied!

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
list of (systemd option)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.requiredBy Link copied!

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
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.requires Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.requisite Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.restartTriggers Link copied!

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

Type
list of unspecified value
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.startLimitBurst Link copied!

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
signed integer
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.startLimitIntervalSec Link copied!

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
signed integer
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.unitConfig Link copied!

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

Type
attribute set of (systemd option)
Default
{ }
Example
{
  RequiresMountsFor = "/data";
}
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.upheldBy Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.upholds Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.wantedBy Link copied!

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 systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.paths.<name>.wants Link copied!

Start the specified units when this unit is started.

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services Link copied!

Definition of systemd per-user service units.

Type
attribute set of (submodule)
Default
{ }
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.enable Link copied!

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
boolean
Default
true
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.enableDefaultPath Link copied!

Whether to append a minimal default PATH environment variable to the service, containing common system utilities.

Type
boolean
Default
true
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.enableStrictShellChecks Link copied!

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
boolean
Default
config.systemd.enableStrictShellChecks
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.after Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.aliases Link copied!

Aliases of that unit.

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.before Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.bindsTo Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.conflicts Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.description Link copied!

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

Type
(optionally newline-terminated) single-line string
Default
""
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.documentation Link copied!

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

Type
list of string
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.environment Link copied!

Environment variables passed to the service's processes.

Type
attribute set of (null or string or absolute path or package)
Default
{ }
Example
{
  LANG = "nl_NL.UTF-8";
  PATH = "/foo/bar/bin";
}
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.name Link copied!

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

Type
string
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.notSocketActivated Link copied!

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
boolean
Default
false
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.onFailure Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.onSuccess Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.overrideStrategy Link copied!

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 systemd.unit(5).

Type
one of "asDropinIfExists", "asDropin"
Default
"asDropinIfExists"
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.partOf Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.path Link copied!

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

Type
list of (package or string)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.postStart Link copied!

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

Type
strings concatenated with "\n"
Default
""
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.postStop Link copied!

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

Type
strings concatenated with "\n"
Default
""
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.preStart Link copied!

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

Type
strings concatenated with "\n"
Default
""
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.preStop Link copied!

Shell commands executed to stop the service.

Type
strings concatenated with "\n"
Default
""
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.reload Link copied!

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

Type
strings concatenated with "\n"
Default
""
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.reloadIfChanged Link copied!

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

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

Type
boolean
Default
false
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.reloadTriggers Link copied!

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
list of (systemd option)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.requiredBy Link copied!

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
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.requires Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.requisite Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.restartIfChanged Link copied!

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

Type
boolean
Default
true
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.restartTriggers Link copied!

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

Type
list of unspecified value
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.script Link copied!

Shell commands executed as the service's main process.

Type
strings concatenated with "\n"
Default
""
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.scriptArgs Link copied!

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

Type
string
Default
""
Example
"%i"
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.serviceConfig Link copied!

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

Type
attribute set of (systemd option)
Default
{ }
Example
{
  RestartSec = 5;
}
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.startAt Link copied!

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

Type
string or list of string
Default
[ ]
Example
"Sun 14:00:00"
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.startLimitBurst Link copied!

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
signed integer
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.startLimitIntervalSec Link copied!

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
signed integer
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.stopIfChanged Link copied!

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

Type
boolean
Default
true
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.unitConfig Link copied!

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

Type
attribute set of (systemd option)
Default
{ }
Example
{
  RequiresMountsFor = "/data";
}
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.upheldBy Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.upholds Link copied!

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

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.wantedBy Link copied!

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 systemd.unit(5) however is not supported because it is a stateful process that does not fit well into the NixOS design.

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.services.<name>.wants Link copied!

Start the specified units when this unit is started.

Type
list of string matching the pattern [a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)
Default
[ ]
Declared in
<hjem/modules/nixos/systemd.nix>

hjem.users.<username>.systemd.slices Link copied!

Definition of systemd per-user slice units.

Type
attribute set of (submodule)
Default
{ }
Declared in
<hjem/modules/nixos/systemd.nix>

More options load as you scroll.