diff --git a/modules/homelab/services/smarthome/homeassistant/default.nix b/modules/homelab/services/smarthome/homeassistant/default.nix index fdadd5d..7a0cea3 100644 --- a/modules/homelab/services/smarthome/homeassistant/default.nix +++ b/modules/homelab/services/smarthome/homeassistant/default.nix @@ -137,8 +137,10 @@ in }; }; - # add to backups - modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ]; + # add to backups + modules.system.backups.baks = { + ${service} = { paths = [ cfg.data_dir ]; }; + }; }; } diff --git a/modules/homelab/services/smarthome/mosquitto/default.nix b/modules/homelab/services/smarthome/mosquitto/default.nix index 6b50590..8318f47 100644 --- a/modules/homelab/services/smarthome/mosquitto/default.nix +++ b/modules/homelab/services/smarthome/mosquitto/default.nix @@ -96,7 +96,9 @@ in }; }; - # add to backups - modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ]; + # add to backups + modules.system.backups.baks = { + ${service} = { paths = [ cfg.data_dir ]; }; + }; }; } diff --git a/modules/homelab/services/smarthome/zigbee2mqtt/default.nix b/modules/homelab/services/smarthome/zigbee2mqtt/default.nix index 01fd800..6c24146 100644 --- a/modules/homelab/services/smarthome/zigbee2mqtt/default.nix +++ b/modules/homelab/services/smarthome/zigbee2mqtt/default.nix @@ -111,7 +111,9 @@ in }; }; - # add to backups - modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ]; + # add to backups + modules.system.backups.baks = { + ${service} = { paths = [ cfg.data_dir ]; }; + }; }; } diff --git a/modules/homelab/services/vaultwarden/default.nix b/modules/homelab/services/vaultwarden/default.nix index bb766e5..4a1e3a6 100644 --- a/modules/homelab/services/vaultwarden/default.nix +++ b/modules/homelab/services/vaultwarden/default.nix @@ -111,6 +111,8 @@ in }; # add to backups - modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ]; + modules.system.backups.baks = { + ${service} = { paths = [ cfg.data_dir ]; }; + }; }; } diff --git a/modules/system/backups.nix b/modules/system/backups.nix index e31ae83..1a34c21 100644 --- a/modules/system/backups.nix +++ b/modules/system/backups.nix @@ -10,7 +10,7 @@ in a borg archive to the specified repo | <3yy> | V V modules.system.backups.baks = { - {service} = { paths = [ cfg.data_dir ]; }; + ${service} = { paths = [ cfg.data_dir ]; }; }; */ @@ -28,6 +28,9 @@ in default = {}; description = "backup jobs, nested attribute sets should be = paths []"; }; + baks = lib.mkOption { + type = lib.types.list + }; repo = lib.mkOption { type = lib.types.path; default = "/holocron/borg";