snowflake/hosts/sora/services/restic.nix

40 lines
859 B
Nix
Raw Normal View History

2023-12-31 09:24:32 -05:00
{
pkgs,
config,
...
}: {
sops.secrets = {
2023-12-31 12:51:49 -05:00
restic-sora = {
sopsFile = ../../../secrets/restic/secrets.yaml;
};
sora-b2 = {
sopsFile = ../../../secrets/b2/secrets.yaml;
};
2023-12-31 09:24:32 -05:00
};
environment.systemPackages = [pkgs.restic];
services.restic = {
backups = {
sora = {
user = "root";
paths = [
2023-12-31 12:51:49 -05:00
"/var/lib/private/uptime-kuma"
"/var/lib/private/ntfy-sh"
2023-12-31 09:24:32 -05:00
];
pruneOpts = [
2023-12-31 12:51:49 -05:00
"--keep-daily=7"
2023-12-31 09:24:32 -05:00
"--keep-weekly=6"
"--keep-monthly=5"
];
repository = "b2:sora-b2";
initialize = true;
2023-12-31 12:51:49 -05:00
passwordFile = config.sops.secrets.restic-sora.path;
2023-12-31 09:24:32 -05:00
environmentFile = config.sops.secrets.sora-b2.path;
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
};
};
}