Skip to content

Tmpfiles

systemd.tmpfiles.packages

List of packages containing {command}systemd-tmpfiles rules.

All files ending in .conf found in {file}«pkg»/lib/tmpfiles.d will be included. If this folder does not exist or does not contain any files an error will be returned instead.

If a {file}lib output is available, rules are searched there and only there. If there is no {file}lib output it will fall back to {file}out and if that does not exist either, the default output will be used.

Type: list of package

Default

[ ]

Example

[ pkgs.lvm2 ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix

systemd.tmpfiles.rules

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

Type: list of string

Default

[ ]

Example

["d /tmp 1777 root root 10d"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix

systemd.tmpfiles.settings

Declare systemd-tmpfiles rules to create, delete, and clean up volatile and temporary files and directories.

Even though the service is called *tmp*files you can also create persistent files.

Type: attribute set of attribute set of attribute set of (submodule)

Default

{ }

Example

{"10-mypackage" = {"/var/lib/my-service/statefolder" = {d = {group = "root";mode = "0755";user = "root";};};};}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix

systemd.tmpfiles.settings.<name>.<name>.<name>.age

Delete a file when it reaches a certain age.

If a file or directory is older than the current time minus the age field, it is deleted.

If set to "-" no automatic clean-up is done.

Type: string

Default

"-"

Example

"10d"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix

systemd.tmpfiles.settings.<name>.<name>.<name>.argument

An argument whose meaning depends on the type of operation.

Please see the upstream documentation for the meaning of this parameter in different situations: https://www.freedesktop.org/software/systemd/man/tmpfiles.d

Type: string

Default

""

Example

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix

systemd.tmpfiles.settings.<name>.<name>.<name>.group

The group of the file.

This may either be a numeric ID or a user/group name.

If omitted or when set to "-", the user and group of the user who invokes systemd-tmpfiles is used.

Type: string

Default

"-"

Example

"root"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix

systemd.tmpfiles.settings.<name>.<name>.<name>.mode

The file access mode to use when creating this file or directory.

Type: string

Default

"-"

Example

"0755"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix

systemd.tmpfiles.settings.<name>.<name>.<name>.type

The type of operation to perform on the file.

The type consists of a single letter and optionally one or more modifier characters.

Please see the upstream documentation for the available types and more details: https://www.freedesktop.org/software/systemd/man/tmpfiles.d

Type: string

Default

"‹name›"

Example

"d"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix

systemd.tmpfiles.settings.<name>.<name>.<name>.user

The user of the file.

This may either be a numeric ID or a user/group name.

If omitted or when set to "-", the user and group of the user who invokes systemd-tmpfiles is used.

Type: string

Default

"-"

Example

"root"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/systemd/tmpfiles.nix