diff --git a/hosts/boreal/default.nix b/hosts/boreal/default.nix index e31549c..b7ab958 100644 --- a/hosts/boreal/default.nix +++ b/hosts/boreal/default.nix @@ -47,6 +47,14 @@ in borg-backup = { enable = true; repo = secrets.borg-backup.boreal-repo; + # for a workstation, having backups spanning the last month should be + # enough + prune = { + keep = { + daily = 7; + weekly = 4; + }; + }; paths = [ "/home/alarsyo" ]; diff --git a/services/borg-backup.nix b/services/borg-backup.nix index 6c4e132..866a2af 100644 --- a/services/borg-backup.nix +++ b/services/borg-backup.nix @@ -14,6 +14,18 @@ in { description = "Borgbase repo info. Required."; }; + prune = mkOption { + type = types.attrs; + default = { + keep = { + daily = 7; + weekly = 4; + monthly = 6; + }; + }; + description = "pruning options for borg"; + }; + paths = mkOption { type = types.listOf types.str; default = []; @@ -57,11 +69,7 @@ in { doInit = true; compression = "auto,zstd"; startAt = "daily"; - prune.keep = { - daily = 7; - weekly = 4; - monthly = 6; - }; + prune = cfg.prune; }; }; }