From f4b71070ce0f1b2d1633b76ecf8d63ac0604cea4 Mon Sep 17 00:00:00 2001 From: blake Date: Sat, 11 Oct 2025 09:48:26 -0500 Subject: [PATCH] 286 current 2025-10-11 09:36:17 25.05.20251006.20c4598 6.12.50 * --- modules/system/backups.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/system/backups.nix b/modules/system/backups.nix index d281600..ab90707 100644 --- a/modules/system/backups.nix +++ b/modules/system/backups.nix @@ -5,11 +5,6 @@ let borg = "${pkgs.borgbackup}/bin/borg"; backup_paths = lib.unique config.modules.system.backups.paths; passwd_file = config.sops.secrets."borg_passwd".path; - jobs = { - sungger = { paths = [ "/var/lib/radarr" "/var/lib/sonarr" ]; }; - hoass = { paths = [ "/var/lib/zigbee2mqtt" "/var/lib/hass" "/var/lib/mosquitto" ]; }; - huh = { paths = [ "/home/blake/.nix" ]; }; - }; in { options.modules.system.backups = { @@ -25,7 +20,7 @@ in lib.types.listOf lib.types.path # the paths ) ); - default = {}; + default = null; description = "Borg backup jobs; each job has a list of paths."; }; repo = lib.mkOption { @@ -42,6 +37,11 @@ in config = lib.mkIf (cfg.enable && backup_paths != []) { + cfg.jobs = { + sungger = { paths = [ "/var/lib/radarr" "/var/lib/sonarr" ]; }; + hoass = { paths = [ "/var/lib/zigbee2mqtt" "/var/lib/hass" "/var/lib/mosquitto" ]; }; + huh = { paths = [ "/home/blake/.nix" ]; }; + }; systemd.services.backups = { description = "backup service with borg!"; @@ -86,7 +86,7 @@ in --keep-weekly=52 \ --keep-monthly=-1 '' - ) jobs)} + ) cfg.jobs)} echo "finshed backup at \"$BORG_REPO::$archive\"" '';