preservation.enable
Whether to enable the preservation module.
Type: boolean
Default:
false
Example:
true
Declared by:
preservation.preserveAt
Specify a set of locations and the corresponding state that should be preserved there.
Type: attribute set of (submodule)
Default:
{ }
Example:
{
"/state" = {
directories = [ "/var/lib/someservice" ];
files = [
{
file = "/etc/wpa_supplicant.conf";
how = "symlink";
}
{
file = "/etc/machine-id";
inInitrd = true;
}
];
users = {
alice.directories = [ ".rabbit_hole" ];
butz = {
files = [
{
file = ".config/foo";
mode = "0600";
}
"bar"
];
directories = [ "unshaved_yaks" ];
};
};
};
}
Declared by:
preservation.preserveAt.<path>.commonMountOptions
Specify a list of mount options that should be added to all files and directories
under this preservation prefix, for which how is set to bindmount.
See also commonMountOptions under users and the invdividual
mountOptions that is available per file / directory.
Type: list of ((submodule) or string convertible to it)
Default:
[ ]
Example:
[
"x-gvfs-hide"
"x-gdu.hide"
]
Declared by:
preservation.preserveAt.<path>.commonMountOptions.*.name
Specify the name of the mount option.
Type: string
Example:
"bind"
Declared by:
preservation.preserveAt.<path>.commonMountOptions.*.value
Optionally specify a value for the mount option.
Type: null or string
Default:
null
Declared by:
preservation.preserveAt.<path>.directories
Specify a list of directories that should be preserved. The paths are interpreted as absolute paths.
Type: list of ((submodule) or string convertible to it)
Default:
[ ]
Example:
[
"/var/lib/someservice"
]
Declared by:
preservation.preserveAt.<path>.directories.*.configureParent
Specify whether the parent directory of this directory shall be configured with custom ownership and permissions.
By default, missing parent directories are always created with ownership
root:root and mode 0755, as described in tmpfiles.d(5).
Ownership and mode may be configured through the options
parent.user,
parent.group,
parent.mode.
Defaults to true when how is set to symlink and
user is not root.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.directories.*.createLinkTarget
Only used when how is set to symlink.
Specify whether to create an empty directory with the specified ownership and permissions as target of the symlink.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.directories.*.directory
Specify the path to the directory that should be preserved.
Type: string
Declared by:
preservation.preserveAt.<path>.directories.*.group
Specify the group that owns the directory.
Type: string
Default:
"config.users.users.\${defaultOwner}.group"
Declared by:
preservation.preserveAt.<path>.directories.*.how
Specify how this directory should be preserved.
-
Either a directory is created both on the volatile and on the persistent volume, with a bind mount from the former to the latter.
-
Or a symlink is created on the volatile volume, pointing to the corresponding location on the persistent volume.
-
Finally the option
_intermediateexists to handle directories which are supposed to be created on both the volatile and persistent volume, but without any preservation of them specifically.
Type: one of “bindmount”, “symlink”, “_intermediate”
Default:
"bindmount"
Declared by:
preservation.preserveAt.<path>.directories.*.inInitrd
Whether to prepare preservation of this directory in initrd.
Note: For most directories there is no need to enable this option.
Important: Note that both owner and group for this directory need to be available in the initrd for permissions to be set correctly.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.directories.*.mode
Specify the access mode of the directory.
See the section Mode in tmpfiles.d(5) for more information.
Type: string
Default:
"0755"
Declared by:
preservation.preserveAt.<path>.directories.*.mountOptions
Specify a list of mount options that should be used for this directory.
These options are only used when how is set to bindmount.
By default, bind and X-fstrim.notrim are added,
use mkForce to override these if needed.
See also fstrim(8).
Type: list of ((submodule) or string convertible to it)
Declared by:
preservation.preserveAt.<path>.directories.*.mountOptions.*.name
Specify the name of the mount option.
Type: string
Example:
"bind"
Declared by:
preservation.preserveAt.<path>.directories.*.mountOptions.*.value
Optionally specify a value for the mount option.
Type: null or string
Default:
null
Declared by:
preservation.preserveAt.<path>.directories.*.parent.group
Specify the group that owns the parent directory of this file.
Type: string
Default:
"config.users.users.\${defaultOwner}.group"
Declared by:
preservation.preserveAt.<path>.directories.*.parent.mode
Specify the access mode of the parent directory of this file.
See the section Mode in tmpfiles.d(5) for more information.
Type: string
Default:
"0755"
Declared by:
preservation.preserveAt.<path>.directories.*.parent.user
Specify the user that owns the parent directory of this file.
Type: string
Default:
"root"
Declared by:
preservation.preserveAt.<path>.directories.*.user
Specify the user that owns the directory.
Type: string
Default:
"root"
Declared by:
preservation.preserveAt.<path>.files
Specify a list of files that should be preserved. The paths are interpreted as absolute paths.
Type: list of ((submodule) or string convertible to it)
Default:
[ ]
Example:
[
{
file = "/etc/wpa_supplicant.conf";
how = "symlink";
}
{
file = "/etc/machine-id";
inInitrd = true;
}
]
Declared by:
preservation.preserveAt.<path>.files.*.configureParent
Specify whether the parent directory of this file shall be configured with custom ownership and permissions.
By default, missing parent directories are always created with ownership
root:root and mode 0755, as described in tmpfiles.d(5).
Ownership and mode may be configured through the options
parent.user,
parent.group,
parent.mode.
Defaults to true when how is set to symlink and
user is not root.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.files.*.createLinkTarget
Only used when how is set to symlink.
Specify whether to create an empty file with the specified ownership and permissions as target of the symlink.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.files.*.file
Specify the path to the file that should be preserved.
Type: string
Declared by:
preservation.preserveAt.<path>.files.*.group
Specify the group that owns the file.
Type: string
Default:
"config.users.users.\${defaultOwner}.group"
Declared by:
preservation.preserveAt.<path>.files.*.how
Specify how this file should be preserved:
-
Either a file is placed both on the volatile and on the persistent volume, with a bind mount from the former to the latter.
-
Or a symlink is created on the volatile volume, pointing to the corresponding location on the persistent volume.
Type: one of “bindmount”, “symlink”
Default:
"bindmount"
Declared by:
preservation.preserveAt.<path>.files.*.inInitrd
Whether to prepare preservation of this file in the initrd.
Note: For most files there is no need to enable this option.
/etc/machine-id is an exception because it needs to
be populated/read very early.
Important: Note that both owner and group for this file need to be available in the initrd for permissions to be set correctly.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.files.*.mode
Specify the access mode of the file.
See the section Mode in tmpfiles.d(5) for more information.
Type: string
Default:
"0644"
Declared by:
preservation.preserveAt.<path>.files.*.mountOptions
Specify a list of mount options that should be used for this file.
These options are only used when how is set to bindmount.
By default, bind is added,
use mkForce to override this if needed.
Type: list of ((submodule) or string convertible to it)
Declared by:
preservation.preserveAt.<path>.files.*.mountOptions.*.name
Specify the name of the mount option.
Type: string
Example:
"bind"
Declared by:
preservation.preserveAt.<path>.files.*.mountOptions.*.value
Optionally specify a value for the mount option.
Type: null or string
Default:
null
Declared by:
preservation.preserveAt.<path>.files.*.parent.group
Specify the group that owns the parent directory of this file.
Type: string
Default:
"config.users.users.\${defaultOwner}.group"
Declared by:
preservation.preserveAt.<path>.files.*.parent.mode
Specify the access mode of the parent directory of this file.
See the section Mode in tmpfiles.d(5) for more information.
Type: string
Default:
"0755"
Declared by:
preservation.preserveAt.<path>.files.*.parent.user
Specify the user that owns the parent directory of this file.
Type: string
Default:
"root"
Declared by:
preservation.preserveAt.<path>.files.*.user
Specify the user that owns the file.
Type: string
Default:
"root"
Declared by:
preservation.preserveAt.<path>.persistentStoragePath
Specify the location at which the directories, files,
users.directories and users.files should be preserved.
Defaults to the name of the parent attribute set.
Type: path
Default:
"‹name›"
Declared by:
preservation.preserveAt.<path>.users
Specify a set of users with corresponding files and directories that should be preserved.
Type: attribute set of (submodule)
Default:
{ }
Example:
{
alice.directories = [ ".rabbit_hole" ];
butz = {
files = [
{
file = ".config/foo";
mode = "0600";
}
"bar"
];
directories = [ "unshaved_yaks" ];
};
}
Declared by:
preservation.preserveAt.<path>.users.<user>.commonMountOptions
Specify a list of mount options that should be added to all files and directories
of this user, for which how is set to bindmount.
See also the top level commonMountOptions and the invdividual
mountOptions that is available per file / directory.
Type: list of ((submodule) or string convertible to it)
Default:
[ ]
Example:
[
"x-gvfs-hide"
"x-gdu.hide"
]
Declared by:
preservation.preserveAt.<path>.users.<user>.commonMountOptions.*.name
Specify the name of the mount option.
Type: string
Example:
"bind"
Declared by:
preservation.preserveAt.<path>.users.<user>.commonMountOptions.*.value
Optionally specify a value for the mount option.
Type: null or string
Default:
null
Declared by:
preservation.preserveAt.<path>.users.<user>.directories
Specify a list of directories that should be preserved for this user.
The paths are interpreted relative to home.
Type: list of ((submodule) or string convertible to it)
Default:
[ ]
Example:
[
".rabbit_hole"
]
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.configureParent
Specify whether the parent directory of this directory shall be configured with custom ownership and permissions.
By default, missing parent directories are always created with ownership
root:root and mode 0755, as described in tmpfiles.d(5).
Ownership and mode may be configured through the options
parent.user,
parent.group,
parent.mode.
Defaults to true when how is set to symlink and
user is not root.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.createLinkTarget
Only used when how is set to symlink.
Specify whether to create an empty directory with the specified ownership and permissions as target of the symlink.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.directory
Specify the path to the directory that should be preserved.
Type: string
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.group
Specify the group that owns the directory.
Type: string
Default:
"config.users.users.\${defaultOwner}.group"
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.how
Specify how this directory should be preserved.
-
Either a directory is created both on the volatile and on the persistent volume, with a bind mount from the former to the latter.
-
Or a symlink is created on the volatile volume, pointing to the corresponding location on the persistent volume.
-
Finally the option
_intermediateexists to handle directories which are supposed to be created on both the volatile and persistent volume, but without any preservation of them specifically.
Type: one of “bindmount”, “symlink”, “_intermediate”
Default:
"bindmount"
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.inInitrd
Whether to prepare preservation of this directory in initrd.
Note: For most directories there is no need to enable this option.
Important: Note that both owner and group for this directory need to be available in the initrd for permissions to be set correctly.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.mode
Specify the access mode of the directory.
See the section Mode in tmpfiles.d(5) for more information.
Type: string
Default:
"0755"
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.mountOptions
Specify a list of mount options that should be used for this directory.
These options are only used when how is set to bindmount.
By default, bind and X-fstrim.notrim are added,
use mkForce to override these if needed.
See also fstrim(8).
Type: list of ((submodule) or string convertible to it)
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.mountOptions.*.name
Specify the name of the mount option.
Type: string
Example:
"bind"
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.mountOptions.*.value
Optionally specify a value for the mount option.
Type: null or string
Default:
null
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.parent.group
Specify the group that owns the parent directory of this file.
Type: string
Default:
"config.users.users.\${defaultOwner}.group"
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.parent.mode
Specify the access mode of the parent directory of this file.
See the section Mode in tmpfiles.d(5) for more information.
Type: string
Default:
"0755"
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.parent.user
Specify the user that owns the parent directory of this file.
Type: string
Default:
"‹name›"
Declared by:
preservation.preserveAt.<path>.users.<user>.directories.*.user
Specify the user that owns the directory.
Type: string
Default:
"‹name›"
Declared by:
preservation.preserveAt.<path>.users.<user>.files
Specify a list of files that should be preserved for this user.
The paths are interpreted relative to home.
Type: list of ((submodule) or string convertible to it)
Default:
[ ]
Example:
[
{
file = ".config/foo";
mode = "0600";
}
"bar"
]
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.configureParent
Specify whether the parent directory of this file shall be configured with custom ownership and permissions.
By default, missing parent directories are always created with ownership
root:root and mode 0755, as described in tmpfiles.d(5).
Ownership and mode may be configured through the options
parent.user,
parent.group,
parent.mode.
Defaults to true when how is set to symlink and
user is not root.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.createLinkTarget
Only used when how is set to symlink.
Specify whether to create an empty file with the specified ownership and permissions as target of the symlink.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.file
Specify the path to the file that should be preserved.
Type: string
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.group
Specify the group that owns the file.
Type: string
Default:
"config.users.users.\${defaultOwner}.group"
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.how
Specify how this file should be preserved:
-
Either a file is placed both on the volatile and on the persistent volume, with a bind mount from the former to the latter.
-
Or a symlink is created on the volatile volume, pointing to the corresponding location on the persistent volume.
Type: one of “bindmount”, “symlink”
Default:
"bindmount"
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.inInitrd
Whether to prepare preservation of this file in the initrd.
Note: For most files there is no need to enable this option.
/etc/machine-id is an exception because it needs to
be populated/read very early.
Important: Note that both owner and group for this file need to be available in the initrd for permissions to be set correctly.
Type: boolean
Default:
false
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.mode
Specify the access mode of the file.
See the section Mode in tmpfiles.d(5) for more information.
Type: string
Default:
"0644"
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.mountOptions
Specify a list of mount options that should be used for this file.
These options are only used when how is set to bindmount.
By default, bind is added,
use mkForce to override this if needed.
Type: list of ((submodule) or string convertible to it)
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.mountOptions.*.name
Specify the name of the mount option.
Type: string
Example:
"bind"
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.mountOptions.*.value
Optionally specify a value for the mount option.
Type: null or string
Default:
null
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.parent.group
Specify the group that owns the parent directory of this file.
Type: string
Default:
"config.users.users.\${defaultOwner}.group"
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.parent.mode
Specify the access mode of the parent directory of this file.
See the section Mode in tmpfiles.d(5) for more information.
Type: string
Default:
"0755"
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.parent.user
Specify the user that owns the parent directory of this file.
Type: string
Default:
"‹name›"
Declared by:
preservation.preserveAt.<path>.users.<user>.files.*.user
Specify the user that owns the file.
Type: string
Default:
"‹name›"
Declared by:
preservation.preserveAt.<path>.users.<user>.home
Specify the path to the user’s home directory.
Type: path, not containing newlines or colons
Default:
"config.users.users.\${name}.home"
Declared by:
preservation.preserveAt.<path>.users.<user>.username
Specify the user for which the directories and files
should be persisted. Defaults to the name of the parent attribute set.
Type: string, not containing newlines or colons
Default:
"‹name›"
Declared by: