restic: add daily external backups of all safe/backups

This commit is contained in:
eyjhb 2024-12-07 19:28:04 +01:00
parent d4d8236501
commit 3a0792caec
Signed by: eyjhb
GPG key ID: 609F508E3239F920
7 changed files with 64 additions and 1 deletions

View file

@ -0,0 +1,30 @@
{ config, lib, ... }:
{
services.restic = {
# enable = true;
backups.main = {
repository = "b2:situla-${config.mine.shared.settings.brand_lower}:.";
passwordFile = config.age.secrets."restic-pass".path;
environmentFile = config.age.secrets."restic-env".path;
# take all `.*/safe/.*` and `.*/backup/.*` zfs volumes
paths = let
backupPaths = lib.filterAttrs (n: _:
(lib.hasInfix "/safe/" n) || (lib.hasInfix "/backup/" n)
) config.mine.zfsMounts;
in lib.attrValues backupPaths;
initialize = true;
runCheck = true;
pruneOpts = [
"--keep-last 7"
"--keep-weekly 4"
"--keep-monthly 6"
"--keep-yearly 2"
];
};
};
}

View file

@ -19,5 +19,6 @@ in {
# mine.shared.settings.domain = "${config.mine.shared.settings.domain_sld}.${config.mine.shared.settings.domain_tld}";
mine.shared.settings.domain = "fricloud.dk";
mine.shared.settings.brand_lower = "fricloud";
mine.shared.settings.brand = "Fricloud";
}