restructure backups

This commit is contained in:
2025-10-18 13:51:23 -05:00
parent f597616843
commit 643ab0958c
22 changed files with 385 additions and 262 deletions

View File

@@ -37,9 +37,15 @@ in
type = lib.types.str;
description = "base domain used for reverse proxy";
};
baks = lib.mkOption {
type = lib.types.attrsOf (lib.types.attrsOf (lib.types.listOf lib.types.path));
default = {};
description = "backup jobs, nested attribute sets should be <bak_name> = paths [<list_of_paths>]";
};
backup_repo = lib.mkOption {
type = lib.types.path;
default = "/holocron/archives/homelab";
description = "path to take daily backups to with borg!";
};
};
@@ -78,7 +84,7 @@ in
};
};
# backups with borg
# backups homelab with borg
services.borgbackup.jobs.homelab = {
archiveBaseName = "homelab";
repo = cfg.backup_repo;
@@ -86,9 +92,10 @@ in
compression = "auto,zstd";
startAt = "daily";
group = "archives";
encryption.mode = "repokey";
encryption.mode = "repokey-blake2";
encryption.passCommand = "cat ${config.sops.secrets."borg_passwd".path}";
extraArgs = ["--verbose" "--list" "--filter AME" "--stats" "--show-rc" "--umask 0007"];
extraArgs = ["--verbose" "--show-rc" "--umask" "0007"];
extraCreateArgs = ["--list" "--stats" "--filter" "AME"];
prune.keep = {
within = "1d"; # Keep all archives from the last day
daily = 7;