puter/hosts/headless/abacus/backup.nix

31 lines
951 B
Nix
Raw Permalink 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
2025-04-08 21:27:00 +00:00
config.services.forgejo.stateDir
config.services.postgresqlBackup.location
config.services.postgresqlBackup.location
# TODO: Add stateDir options for these
"/var/lib/headscale"
"/var/lib/navidrome"
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'"];
};
}