2024-03-08 01:48:06 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
2024-10-05 10:53:54 +02:00
|
|
|
services.restic.backups = let
|
|
|
|
localJob = name: paths: {
|
|
|
|
inherit paths;
|
|
|
|
repository = "/mnt/feal-syn1/backup/defiant/${name}";
|
|
|
|
passwordFile = config.sops.secrets."restic/${name}".path;
|
|
|
|
initialize = true;
|
|
|
|
pruneOpts = [
|
|
|
|
"--keep-daily 3"
|
|
|
|
"--keep-weekly 4"
|
|
|
|
"--keep-monthly 3"
|
|
|
|
];
|
2024-03-08 01:48:06 +01:00
|
|
|
};
|
2024-10-05 10:53:54 +02:00
|
|
|
in {
|
|
|
|
postgres = (localJob "postgres" [ "/tank/backup/postgresql" ]) // {
|
|
|
|
timerConfig.OnCalendar = "05:15"; # 2h after postgresqlBackup
|
|
|
|
};
|
|
|
|
|
|
|
|
gitea = (localJob "gitea" [ "/tank/services/gitea" ]);
|
|
|
|
matrix-synapse = (localJob "matrix-synapse" [ "/var/lib/matrix-synapse" ]);
|
|
|
|
vaultwarden = (localJob "vaultwarden" [ "/var/lib/bitwarden_rs" ]);
|
|
|
|
};
|
2024-03-08 01:48:06 +01:00
|
|
|
|
2024-10-05 10:53:54 +02:00
|
|
|
# TODO: home-assistant, pihole
|
|
|
|
sops.secrets."restic/postgres" = { };
|
|
|
|
sops.secrets."restic/gitea" = { };
|
|
|
|
sops.secrets."restic/matrix-synapse" = { };
|
|
|
|
sops.secrets."restic/vaultwarden" = { };
|
2024-03-08 01:48:06 +01:00
|
|
|
}
|