286 current 2025-10-11 09:36:17 25.05.20251006.20c4598 6.12.50 *

This commit is contained in:
2025-10-11 09:48:26 -05:00
parent badcab048c
commit f4b71070ce

View File

@@ -5,11 +5,6 @@ let
borg = "${pkgs.borgbackup}/bin/borg"; borg = "${pkgs.borgbackup}/bin/borg";
backup_paths = lib.unique config.modules.system.backups.paths; backup_paths = lib.unique config.modules.system.backups.paths;
passwd_file = config.sops.secrets."borg_passwd".path; 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 in
{ {
options.modules.system.backups = { options.modules.system.backups = {
@@ -25,7 +20,7 @@ in
lib.types.listOf lib.types.path # the paths lib.types.listOf lib.types.path # the paths
) )
); );
default = {}; default = null;
description = "Borg backup jobs; each job has a list of paths."; description = "Borg backup jobs; each job has a list of paths.";
}; };
repo = lib.mkOption { repo = lib.mkOption {
@@ -42,6 +37,11 @@ in
config = lib.mkIf (cfg.enable && backup_paths != []) { 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 = { systemd.services.backups = {
description = "backup service with borg!"; description = "backup service with borg!";
@@ -86,7 +86,7 @@ in
--keep-weekly=52 \ --keep-weekly=52 \
--keep-monthly=-1 --keep-monthly=-1
'' ''
) jobs)} ) cfg.jobs)}
echo "finshed backup at \"$BORG_REPO::$archive\"" echo "finshed backup at \"$BORG_REPO::$archive\""
''; '';