puter/hosts/abacus/backup.nix

24 lines
730 B
Nix
Raw Normal View History

2024-08-18 00:55:37 +00:00
{
attrName,
config,
...
}: {
age.secrets."restic-${attrName}".file = ../../secrets/restic-${attrName}.age;
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'"];
};
}