2024-09-27 05:37:34 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
systemd.timers.restic-backups-sysbackup.wantedBy = lib.mkForce ["multi-user.target"];
|
2022-01-15 17:08:47 +00:00
|
|
|
services.restic.backups."sysbackup" = {
|
2024-05-06 08:58:52 +00:00
|
|
|
timerConfig = {
|
|
|
|
OnUnitActiveSec = "12h";
|
|
|
|
RandomizedDelaySec = "1d";
|
2024-09-29 09:00:20 +00:00
|
|
|
OnActiveSec = "1m";
|
2024-05-06 08:58:52 +00:00
|
|
|
};
|
|
|
|
environmentFile = config.sops.secrets."security/restic/env".path;
|
2022-01-15 17:08:47 +00:00
|
|
|
paths = [
|
|
|
|
"/var"
|
|
|
|
"/home"
|
2024-07-28 06:20:04 +00:00
|
|
|
"/root"
|
2022-01-15 17:08:47 +00:00
|
|
|
];
|
2022-01-21 17:03:35 +00:00
|
|
|
extraBackupArgs = [
|
|
|
|
"--exclude-caches"
|
2022-09-13 08:18:37 +00:00
|
|
|
"--compression max"
|
2023-06-07 04:43:09 +00:00
|
|
|
"--exclude"
|
|
|
|
"/var/tmp"
|
|
|
|
"--exclude"
|
|
|
|
"/var/cache"
|
|
|
|
"--exclude"
|
|
|
|
"/root/.cache"
|
|
|
|
"--exclude"
|
|
|
|
"/home/darkkirb/.cache"
|
|
|
|
"--exclude"
|
2023-06-08 19:33:36 +00:00
|
|
|
"/var/lib/ipfs/root"
|
2022-01-21 17:03:35 +00:00
|
|
|
];
|
2024-05-06 11:44:58 +00:00
|
|
|
repository = "s3://ams1.vultrobjects.com/backup-chir-rs";
|
|
|
|
passwordFile = config.sops.secrets."security/restic/password".path;
|
2022-01-15 17:08:47 +00:00
|
|
|
};
|
2024-05-06 08:58:52 +00:00
|
|
|
sops.secrets."security/restic/env" = {
|
|
|
|
sopsFile = ../../secrets/shared.yaml;
|
|
|
|
};
|
2024-05-06 11:44:58 +00:00
|
|
|
sops.secrets."security/restic/password" = {
|
|
|
|
sopsFile = ../../secrets/shared.yaml;
|
|
|
|
};
|
2022-01-15 17:08:47 +00:00
|
|
|
}
|