nixos/hosts/architect/backup.nix
2021-07-07 11:45:37 +02:00

27 lines
533 B
Nix

{config, lib, ...} :
{
services.restic.backups = {
local = {
initialize = true;
passwordFile = "/etc/restic/local.key";
repository = "/backup";
paths = [ "/" ];
extraBackupArgs = [
"-x" # same filesystem
"-e /nix"
];
pruneOpts = [
"--keep-daily 45"
"--keep-weekly 12"
"--keep-monthly 12"
"--keep-yearly 3"
];
timerConfig = {
OnCalendar = "00:05";
RandomizedDelaySec = "5h";
};
};
};
}