diff --git a/modules/system/services/actualbudget.nix b/modules/system/services/actualbudget.nix index 53909e9..e3e27aa 100644 --- a/modules/system/services/actualbudget.nix +++ b/modules/system/services/actualbudget.nix @@ -32,7 +32,7 @@ in custom.services.resticBackups.actual = lib.mkIf cfg.doBackups { conflictingService = "actual.service"; - extraConfig.paths = [ config.services.actual.settings.dataDir ]; + paths = [ config.services.actual.settings.dataDir ]; }; }; } diff --git a/modules/system/services/filebrowser.nix b/modules/system/services/filebrowser.nix index 92c98d1..e9c8644 100644 --- a/modules/system/services/filebrowser.nix +++ b/modules/system/services/filebrowser.nix @@ -39,7 +39,7 @@ in custom.services.resticBackups.filebrowser = lib.mkIf cfg.doBackups { conflictingService = "filebrowser.service"; - extraConfig.paths = with config.services.filebrowser.settings; [ + paths = with config.services.filebrowser.settings; [ database root ]; diff --git a/modules/system/services/forgejo/default.nix b/modules/system/services/forgejo/default.nix index bbe0ace..0405b88 100644 --- a/modules/system/services/forgejo/default.nix +++ b/modules/system/services/forgejo/default.nix @@ -89,7 +89,7 @@ in custom.services.resticBackups.forgejo = lib.mkIf cfg.doBackups { conflictingService = "forgejo.service"; - extraConfig.paths = [ config.services.forgejo.stateDir ]; + paths = [ config.services.forgejo.stateDir ]; }; }; } diff --git a/modules/system/services/hedgedoc.nix b/modules/system/services/hedgedoc.nix index d40efb8..0862a07 100644 --- a/modules/system/services/hedgedoc.nix +++ b/modules/system/services/hedgedoc.nix @@ -68,14 +68,10 @@ in custom.services.resticBackups.hedgedoc = lib.mkIf cfg.doBackups { conflictingService = "hedgedoc.service"; - extraConfig.paths = - let - hedgedocSettings = config.services.hedgedoc.settings; - in - [ - hedgedocSettings.uploadsPath - hedgedocSettings.db.storage - ]; + paths = with config.services.hedgedoc.settings; [ + uploadsPath + db.storage + ]; }; }; } diff --git a/modules/system/services/nextcloud/backups.nix b/modules/system/services/nextcloud/backups.nix index 19d226a..409b3f4 100644 --- a/modules/system/services/nextcloud/backups.nix +++ b/modules/system/services/nextcloud/backups.nix @@ -17,17 +17,18 @@ in config = lib.mkIf cfg.doBackups { custom.services.resticBackups.nextcloud = { + paths = [ + "${dataDir}/data" + "${dataDir}/config/config.php" + "${dataDir}/db.dump" + ]; + extraConfig = { backupPrepareCommand = '' ${nextcloud-occ} maintenance:mode --on ${lib.getExe pkgs.sudo} --user=${user} ${lib.getExe' config.services.postgresql.package "pg_dump"} nextcloud --format=custom --file=${dataDir}/db.dump ''; backupCleanupCommand = "${nextcloud-occ} maintenance:mode --off"; - paths = [ - "${dataDir}/data" - "${dataDir}/config/config.php" - "${dataDir}/db.dump" - ]; }; restoreCommand = { diff --git a/modules/system/services/restic-backups/default.nix b/modules/system/services/restic-backups/default.nix index 75e4ae4..c5dc846 100644 --- a/modules/system/services/restic-backups/default.nix +++ b/modules/system/services/restic-backups/default.nix @@ -14,6 +14,10 @@ in type = lib.types.nullOr lib.types.nonEmptyStr; default = null; }; + paths = lib.mkOption { + type = lib.types.listOf lib.types.path; + default = [ ]; + }; extraConfig = lib.mkOption { type = lib.types.attrsOf lib.types.anything; default = { }; @@ -47,6 +51,7 @@ in name: value: lib.mkMerge [ { + inherit (value) paths; initialize = true; repository = "s3:https://s3.eu-central-003.backblazeb2.com/stork-atlas/${name}"; environmentFile = config.sops.templates."restic/environment".path; diff --git a/modules/system/services/syncthing.nix b/modules/system/services/syncthing.nix index 3bc8557..849b6df 100644 --- a/modules/system/services/syncthing.nix +++ b/modules/system/services/syncthing.nix @@ -121,7 +121,7 @@ in custom.services.resticBackups.syncthing = lib.mkIf cfg.doBackups { conflictingService = "syncthing.service"; - extraConfig.paths = [ config.services.syncthing.dataDir ]; + paths = [ config.services.syncthing.dataDir ]; }; }; }