snowflake/hosts/ame/services/restic.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2023-06-11 00:04:15 -04:00
{
pkgs,
config,
...
}: {
2024-01-15 02:28:23 -05:00
sops.secrets.restic-ame = {
sopsFile = ../../../secrets/restic/secrets.yaml;
};
2024-01-15 02:41:52 -05:00
sops.secrets.ame-s3 = {
sopsFile = ../../../secrets/s3/secrets.yaml;
};
2023-06-11 00:04:15 -04:00
environment.systemPackages = [pkgs.restic];
services.restic = {
backups = {
ame = {
paths = [
"/home"
];
exclude = [
"*.qcow2"
"*.iso"
"/home/*/Downloads"
"/home/*/Videos"
"/home/*/.cache"
"/home/*/.rustup"
"/home/*/.cargo"
"/home/*/.mplayer"
"/home/*/.local/share/Trash"
"/home/*/.local/share/.var"
];
pruneOpts = [
2024-01-15 02:41:52 -05:00
"--keep-daily=7"
"--keep-weekly=6"
"--keep-monthly=5"
2023-06-11 00:04:15 -04:00
];
initialize = true;
2024-01-15 02:41:52 -05:00
repository = "s3:https://s3.flake.sh/restic-ame";
2024-01-15 02:28:23 -05:00
passwordFile = config.sops.secrets.restic-ame.path;
2024-01-15 02:41:52 -05:00
environmentFile = config.sops.secrets.ame-s3.path;
2023-06-11 00:04:15 -04:00
timerConfig = {
OnCalendar = "daily";
2024-01-15 02:41:52 -05:00
Persistent = true;
2023-06-11 00:04:15 -04:00
};
};
};
};
}