Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

systemd.user.enable

Whether to enable the user systemd service manager.

Type: boolean

Default:

pkgs.stdenv.isLinux

Example:

true

Declared by:

systemd.user.packages

Packages providing systemd user units.

This is the Home Manager equivalent of NixOS’s systemd.packages option.

Files in «pkg»/share/systemd/user will be included in the user’s $XDG_DATA_HOME/systemd/user directory.

Type: list of package

Default:

[ ]

Declared by:

systemd.user.automounts

Definition of systemd per-user automount units. Attributes are merged recursively.

Note that the attributes follow the capitalization and naming used by systemd. More details can be found in systemd.automount(5).

Type: attribute set of (open submodule of systemd automount unit configuration)

Default:

{ }

Example:

{
  automount-name = {
    Unit = {
      Description = "Example description";
      Documentation = [ "man:example(1)" "man:example(5)" ];
    };

    Automount = {
      …
    };
  };
};

Declared by:

systemd.user.automounts.<name>.Unit.Description

A short human-readable label of the unit.

Type: null or string

Default:

null

Example:

"My daily database backup"

Declared by:

systemd.user.automounts.<name>.Unit.Documentation

List of URIs referencing documentation for the unit.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "my-automount.automount"
]

Declared by:

systemd.user.mounts

Definition of systemd per-user mount units. Attributes are merged recursively.

Note that the attributes follow the capitalization and naming used by systemd. More details can be found in systemd.mount(5).

Type: attribute set of (open submodule of systemd mount unit configuration)

Default:

{ }

Example:

{
  mount-name = {
    Unit = {
      Description = "Example description";
      Documentation = [ "man:example(1)" "man:example(5)" ];
    };

    Mount = {
      …
    };
  };
};

Declared by:

systemd.user.mounts.<name>.Unit.Description

A short human-readable label of the unit.

Type: null or string

Default:

null

Example:

"My daily database backup"

Declared by:

systemd.user.mounts.<name>.Unit.Documentation

List of URIs referencing documentation for the unit.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "my-mount.mount"
]

Declared by:

systemd.user.paths

Definition of systemd per-user path units. Attributes are merged recursively.

Note that the attributes follow the capitalization and naming used by systemd. More details can be found in systemd.path(5).

Type: attribute set of (open submodule of systemd path unit configuration)

Default:

{ }

Example:

{
  path-name = {
    Unit = {
      Description = "Example description";
      Documentation = [ "man:example(1)" "man:example(5)" ];
    };

    Path = {
      …
    };
  };
};

Declared by:

systemd.user.paths.<name>.Unit.Description

A short human-readable label of the unit.

Type: null or string

Default:

null

Example:

"My daily database backup"

Declared by:

systemd.user.paths.<name>.Unit.Documentation

List of URIs referencing documentation for the unit.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "my-path.path"
]

Declared by:

systemd.user.services

Definition of systemd per-user service units. Attributes are merged recursively.

Note that the attributes follow the capitalization and naming used by systemd. More details can be found in systemd.service(5).

Type: attribute set of (open submodule of systemd service unit configuration)

Default:

{ }

Example:

{
  service-name = {
    Unit = {
      Description = "Example description";
      Documentation = [ "man:example(1)" "man:example(5)" ];
    };

    Service = {
      …
    };
  };
};

Declared by:

systemd.user.services.<name>.Service.Environment

Environment variables available to executed processes.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "VAR1=foo"
  "VAR2=\"bar baz\""
]

Declared by:

systemd.user.services.<name>.Service.ExecStart

Command that is executed when this service is started.

Type: package or string or list of (package or string)

Default:

[ ]

Example:

"/absolute/path/to/command arg1 arg2"

Declared by:

systemd.user.services.<name>.Unit.Description

A short human-readable label of the unit.

Type: null or string

Default:

null

Example:

"My daily database backup"

Declared by:

systemd.user.services.<name>.Unit.Documentation

List of URIs referencing documentation for the unit.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "my-service.service"
]

Declared by:

systemd.user.services.<name>.Unit.X-Reload-Triggers

List of free form strings that can be used to trigger a service reload during Home Manager activation.

Type: list of (package or string)

Default:

[ ]

Example:

[ config.xdg.configFile."service.conf".source ]

Declared by:

systemd.user.services.<name>.Unit.X-Restart-Triggers

List of free form strings that can be used to trigger a service restart during Home Manager activation.

Type: list of (package or string)

Default:

[ ]

Example:

[ config.xdg.configFile."service.conf".source ]

Declared by:

systemd.user.services.<name>.Unit.X-SwitchMethod

The preferred method to use when switching from an old to a new version of this service.

Type: one of <null>, “reload”, “restart”, “stop-start”, “keep-old”

Default:

null

Example:

[ "${config.xdg.configFile."service.conf".source}" ]

Declared by:

systemd.user.servicesStartTimeoutMs

How long to wait for started services to fail until their start is considered successful. The value 0 indicates no timeout.

Type: unsigned integer, meaning >=0

Default:

0

Declared by:

systemd.user.sessionVariables

Environment variables that will be set for the user session. The variable values must be as described in environment.d(5).

Type: attribute set of (signed integer or string)

Default:

{ }

Example:

{
  EDITOR = "vim";
}

Declared by:

systemd.user.settings

Extra config options for user session service manager. See systemd-user.conf(5) for available options.

Type: open submodule of attribute set of section of an INI file (attrs of INI atom (null, bool, int, float or string) or a list of them for duplicate keys)

Default:

{ }

Example:

{
  Manager = {
    DefaultCPUAccounting = true;
  };
}

Declared by:

systemd.user.settings.Manager.DefaultEnvironment

Configures environment variables passed to all executed processes.

Type: attribute set of (null or string or absolute path or package)

Default:

{ }

Example:

{
  PATH = "%u/bin:%u/.cargo/bin";
}

Declared by:

systemd.user.settings.Manager.ManagerEnvironment

Sets environment variables just for the manager process itself.

Type: attribute set of (null or string or absolute path or package)

Default:

{ }

Example:

{
  PATH = "%u/bin:%u/.cargo/bin";
}

Declared by:

systemd.user.slices

Definition of systemd per-user slice units. Attributes are merged recursively.

Note that the attributes follow the capitalization and naming used by systemd. More details can be found in systemd.slice(5).

Type: attribute set of (open submodule of systemd slice unit configuration)

Default:

{ }

Example:

{
  slice-name = {
    Unit = {
      Description = "Example description";
      Documentation = [ "man:example(1)" "man:example(5)" ];
    };

    Slice = {
      …
    };
  };
};

Declared by:

systemd.user.slices.<name>.Unit.Description

A short human-readable label of the unit.

Type: null or string

Default:

null

Example:

"My daily database backup"

Declared by:

systemd.user.slices.<name>.Unit.Documentation

List of URIs referencing documentation for the unit.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "my-slice.slice"
]

Declared by:

systemd.user.sockets

Definition of systemd per-user socket units. Attributes are merged recursively.

Note that the attributes follow the capitalization and naming used by systemd. More details can be found in systemd.socket(5).

Type: attribute set of (open submodule of systemd socket unit configuration)

Default:

{ }

Example:

{
  socket-name = {
    Unit = {
      Description = "Example description";
      Documentation = [ "man:example(1)" "man:example(5)" ];
    };

    Socket = {
      …
    };
  };
};

Declared by:

systemd.user.sockets.<name>.Unit.Description

A short human-readable label of the unit.

Type: null or string

Default:

null

Example:

"My daily database backup"

Declared by:

systemd.user.sockets.<name>.Unit.Documentation

List of URIs referencing documentation for the unit.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "my-socket.socket"
]

Declared by:

systemd.user.startServices

Whether new or changed services that are wanted by active targets should be started. Additionally, stop obsolete services from the previous generation.

The alternatives are

  • suggest (or false)‌

    Use a very simple shell script to print suggested systemctl commands to run. You will have to manually run those commands after the switch.

  • sd-switch (or true)‌

    Use sd-switch, a tool that determines the necessary changes and automatically apply them.

Type: boolean or one of “suggest”, “sd-switch”

Default:

true

Declared by:

systemd.user.systemctlPath

Absolute path to the systemctl tool. This option may need to be set if running Home Manager on a non-NixOS distribution.

Type: string

Default:

"${pkgs.systemd}/bin/systemctl"

Declared by:

systemd.user.targets

Definition of systemd per-user target units. Attributes are merged recursively.

Note that the attributes follow the capitalization and naming used by systemd. More details can be found in systemd.target(5).

Type: attribute set of (open submodule of systemd target unit configuration)

Default:

{ }

Example:

{
  target-name = {
    Unit = {
      Description = "Example description";
      Documentation = [ "man:example(1)" "man:example(5)" ];
    };

    Target = {
      …
    };
  };
};

Declared by:

systemd.user.targets.<name>.Unit.Description

A short human-readable label of the unit.

Type: null or string

Default:

null

Example:

"My daily database backup"

Declared by:

systemd.user.targets.<name>.Unit.Documentation

List of URIs referencing documentation for the unit.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "my-target.target"
]

Declared by:

systemd.user.timers

Definition of systemd per-user timer units. Attributes are merged recursively.

Note that the attributes follow the capitalization and naming used by systemd. More details can be found in systemd.timer(5).

Type: attribute set of (open submodule of systemd timer unit configuration)

Default:

{ }

Example:

{
  timer-name = {
    Unit = {
      Description = "Example description";
      Documentation = [ "man:example(1)" "man:example(5)" ];
    };

    Timer = {
      …
    };
  };
};

Declared by:

systemd.user.timers.<name>.Unit.Description

A short human-readable label of the unit.

Type: null or string

Default:

null

Example:

"My daily database backup"

Declared by:

systemd.user.timers.<name>.Unit.Documentation

List of URIs referencing documentation for the unit.

Type: (list of string) or string convertible to it

Default:

[ ]

Example:

[
  "my-timer.timer"
]

Declared by:

systemd.user.tmpfiles.rules

Rules for creating and cleaning up temporary files automatically. See tmpfiles.d(5) for the exact format.

Type: list of string

Default:

[ ]

Example:

[
  "L /home/user/Documents - - - - /mnt/data/Documents"
]

Declared by: