MyNixOS website logo

Backup configurations for Restic.

On Linux systems, a corresponding systemd user service (and optionally a systemd timer for automatic scheduling) will be created, along with a helper wrapper script.

On non-Linux platforms, only the helper wrapper script will be created.

Declarations
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";
    };
  };
}