From 45c5d07f46180546eab85b71ebf54c5a1d28b546 Mon Sep 17 00:00:00 2001
From: khaneliman
services.restic.enable
+
+
+Whether to enable restic.
+ +Type: +boolean
+ +Default:
+false
Example:
+true
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups
+
+
+Periodic backups to create with Restic.
+ +Type: +attribute set of (submodule)
+ +Default:
+{ }
Example:
{
+ localbackup = {
+ exclude = [
+ "/home/*/.cache"
+ ];
+ initialize = true;
+ passwordFile = "/etc/nixos/secrets/restic-password";
+ paths = [
+ "/home"
+ ];
+ repository = "/mnt/backup-hdd";
+ };
+ remotebackup = {
+ extraOptions = [
+ "sftp.command='ssh backup@host -i /etc/nixos/secrets/backup-private-key -s sftp'"
+ ];
+ passwordFile = "/etc/nixos/secrets/restic-password";
+ paths = [
+ "/home"
+ ];
+ repository = "sftp:backup@host:/backups/home";
+ timerConfig = {
+ OnCalendar = "00:05";
+ RandomizedDelaySec = "5h";
+ };
+ };
+}
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.package
+
+
+The restic package to use.
+ +Type: +package
+ +Default:
+pkgs.restic
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.backupCleanupCommand
+
+
+A script that must run after finishing the backup process.
+ +Type: +null or string
+ +Default:
+null
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.backupPrepareCommand
+
+
+A script that must run before starting the backup process.
+ +Type: +null or string
+ +Default:
+null
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.checkOpts
+
+
+A list of options for ‘restic check’.
+ +Type: +list of string
+ +Default:
+[ ]
Example:
[
+ "--with-cache"
+]
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.createWrapper
+
+
+Whether to generate and add a script to the system path, that has the +same environment variables set as the systemd service. This can be used +to e.g. mount snapshots or perform other opterations, without having to +manually specify most options.
+ +Type: +boolean
+ +Default:
+true
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.dynamicFilesFrom
+
+
+A script that produces a list of files to back up. The results of
+this command, along with the paths specified via paths,
+are given to the ‘–files-from’ option.
Type: +null or string
+ +Default:
+null
Example:
+"find /home/alice/git -type d -name .git"
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.environmentFile
+
+
+A file containing the credentials to access the repository, in the +format of an EnvironmentFile as described by systemd.exec(5). +See https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html +for the specific credentials you will need for your backend.
+ +Type: +null or string
+ +Default:
+null
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.exclude
+
+
+Patterns to exclude when backing up. See +https://restic.readthedocs.io/en/stable/040_backup.html#excluding-files for +details on syntax.
+ +Type: +list of string
+ +Default:
+[ ]
Example:
[
+ "/var/cache"
+ "/home/*/.cache"
+ ".git"
+]
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.extraBackupArgs
+
+
+Extra arguments passed to restic backup.
+ +Type: +list of string
+ +Default:
+[ ]
Example:
[
+ "--cleanup-cache"
+ "--exclude-file=/etc/nixos/restic-ignore"
+]
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.extraOptions
+
+
+Extra extended options to be passed to the restic -o flag. See the restic
+documentation for more details.
Type: +list of string
+ +Default:
+[ ]
Example:
[
+ "sftp.command='ssh backup@192.168.1.100 -i /home/user/.ssh/id_rsa -s sftp'"
+]
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.inhibitsSleep
+
+
+Prevents the system from sleeping while backing up. This uses systemd-inhibit
+to block system idling so you may need to enable polkitd with
+security.polkit.enable.
Type: +boolean
+ +Default:
+false
Example:
+true
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.initialize
+
+
+Create the repository if it does not already exist.
+ +Type: +boolean
+ +Default:
+false
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.passwordFile
+
+
+A file containing the repository password.
+ +Type: +string
+ +Example:
+"/etc/nixos/restic-password"
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.paths
+
+
+Paths to back up, alongside those defined by the dynamicFilesFrom
+option. If left empty and dynamicFilesFrom is also not specified, no
+backup command will be run. This can be used to create a prune-only job.
Type: +list of string
+ +Default:
+[ ]
Example:
[
+ "/var/lib/postgresql"
+ "/home/user/backup"
+]
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.progressFps
+
+
+Controls the frequency of progress reporting.
+ +Type: +null or (nonnegative integer or floating point number, meaning >=0)
+ +Default:
+null
Example:
+0.1
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.pruneOpts
+
+
+A list of policy options for ‘restic forget --prune’, to automatically +prune old snapshots. See +https://restic.readthedocs.io/en/latest/060_forget.html#removing-snapshots-according-to-a-policy +for a full list of options.
Note: The ‘forget’ command is run after the ‘backup’ command, so keep +that in mind when constructing the --keep-* options.
+ +Type: +list of string
+ +Default:
+[ ]
Example:
[
+ "--keep-daily 7"
+ "--keep-weekly 5"
+ "--keep-monthly 12"
+ "--keep-yearly 75"
+]
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.rcloneOptions
+
+
+Options to pass to rclone to control its behavior. See
+https://rclone.org/docs/#options for available options. When specifying
+option names, strip the leading --. To set a flag such as
+--drive-use-trash, which does not take a value, set the value to the
+Boolean true.
Type: +attribute set of (string or boolean)
+ +Default:
+{ }
Example:
{
+ bwlimit = "10M";
+ drive-use-trash = true;
+}
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.repository
+
+
+Repository to backup to. This should be in the form of a backend specification as +detailed here +https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html.
If your using the rclone backend, you can configure your remotes with
+programs.rclone.remotes then use them in your backend specification.
Type: +null or string
+ +Default:
+null
Example:
+"sftp:backup@192.168.1.100:/backups/‹name›"
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.repositoryFile
+
+
+Path to a file containing the repository location to backup to. This should be
+in the same form as the repository option.
Type: +null or absolute path
+ +Default:
+null
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.runCheck
+
+
+Whether to run ‘restic check’ with the provided checkOpts options.
Type: +boolean
+ +Default:
+lib.length config.checkOpts > 0 || lib.length config.pruneOpts > 0
Example:
+true
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.ssh-package
+
+
+The openssh package to use.
+ +Type: +package
+ +Default:
+pkgs.openssh
Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.restic.backups.<name>.timerConfig
+
+
+When to run the backup. See systemd.timer(5) for details. If null +no timer is created and the backup will only run when explicitly started.
+ +Type: +null or (attribute set of (boolean or signed integer or string or absolute path or list of (boolean or signed integer or string or absolute path)))
+ +Default:
{
+ OnCalendar = "daily";
+ Persistent = true;
+}
+
+
+Example:
{
+ OnCalendar = "00:05";
+ Persistent = true;
+ RandomizedDelaySec = "5h";
+}
+
+
+Declared by:
+
+
+<home-manager/modules/services/restic.nix>
+
+ |
services.rsibreak.enable