snowflake/hosts/ame/services/restic.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2024-02-08 12:04:15 -05:00
{ pkgs, config, ... }:
2023-06-11 00:04:15 -04:00
{
2024-02-08 12:04:15 -05:00
sops.secrets.restic-ame = {
sopsFile = ../../../secrets/restic/secrets.yaml;
};
sops.secrets.ame-s3 = {
sopsFile = ../../../secrets/s3/secrets.yaml;
};
environment.systemPackages = [ pkgs.restic ];
2023-06-11 00:04:15 -04:00
services.restic = {
backups = {
ame = {
2024-02-08 12:04:15 -05:00
paths = [ "/home" ];
2023-06-11 00:04:15 -04:00
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
};
};
};
};
}