puter/hosts/headless/abacus/backup.nix

25 lines
717 B
Nix
Raw Normal View History

2024-08-18 00:55:37 +00:00
{
attrName,
config,
2024-12-01 03:05:16 +00:00
lib,
2024-08-18 00:55:37 +00:00
...
}: {
2024-12-01 03:05:16 +00:00
age.secrets = lib.mkSecrets {"restic-${attrName}" = {};};
2024-08-18 00:55:37 +00:00
services.restic.backups.${attrName} = {
repository = "sftp:u385962@u385962.your-storagebox.de:/restic/${attrName}";
initialize = true;
2024-08-18 12:54:44 +00:00
paths = [
config.services.vaultwarden.backupDir
2024-08-20 21:43:41 +00:00
config.services.syncthing.dataDir
2024-08-18 12:54:44 +00:00
];
2024-08-18 00:55:37 +00:00
passwordFile = config.age.secrets."restic-${attrName}".path;
pruneOpts = ["--keep-daily 7" "--keep-weekly 5" "--keep-monthly 12"];
timerConfig = {
OnCalendar = "*-*-* 03:00:00";
Persistent = true;
};
extraOptions = ["sftp.args='-i /etc/ssh/ssh_host_ed25519_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'"];
};
}