From 58595866afa26fdbc4915edc0e9be5c2e6cd094d Mon Sep 17 00:00:00 2001 From: wo2wz <189177184+wo2wz@users.noreply.github.com> Date: Tue, 16 Dec 2025 10:18:40 -0500 Subject: [PATCH] restic: clean up modules --- modules/nixos/services/gameserver/restic.nix | 5 +- .../services/homeserver/restic/backups.nix | 76 +++++++------------ 2 files changed, 32 insertions(+), 49 deletions(-) diff --git a/modules/nixos/services/gameserver/restic.nix b/modules/nixos/services/gameserver/restic.nix index 2549153..60b88ef 100644 --- a/modules/nixos/services/gameserver/restic.nix +++ b/modules/nixos/services/gameserver/restic.nix @@ -14,8 +14,6 @@ exec /run/wrappers/bin/restic "$@" ''; - initialize = true; - repository = "rest:https://restic.taild5f7e6.ts.net/gutterman/gameservers"; environmentFile = config.sops.secrets."restic/rest-auth.env".path; passwordFile = config.sops.secrets."restic/password".path; timerConfig = { @@ -23,6 +21,9 @@ Persistent = true; }; + repository = "rest:https://restic.taild5f7e6.ts.net/gutterman/gameservers"; + initialize = true; + paths = [ "/var/lib/minecraft" ]; diff --git a/modules/nixos/services/homeserver/restic/backups.nix b/modules/nixos/services/homeserver/restic/backups.nix index dbd4da3..4d9e33e 100644 --- a/modules/nixos/services/homeserver/restic/backups.nix +++ b/modules/nixos/services/homeserver/restic/backups.nix @@ -44,57 +44,39 @@ restic-backups-main.serviceConfig.Type = "oneshot"; }; - services.restic.backups = { - main = { - user = "restic-backup"; - package = pkgs.writeShellScriptBin "restic" '' - exec /run/wrappers/bin/restic "$@" - ''; + services.restic.backups.main = { + user = "restic-backup"; + package = pkgs.writeShellScriptBin "restic" '' + exec /run/wrappers/bin/restic "$@" + ''; - initialize = true; - repository = "rest:http://localhost:8001/drone"; - environmentFile = config.sops.secrets."restic/rest-auth.env".path; - passwordFile = config.sops.secrets."restic/password".path; - timerConfig = { - OnCalendar = "03:00"; - Persistent = true; - }; - - paths = [ - "/var/lib/jellyfin" - "/var/lib/vaultwarden" - "/var/backups/db-backup" - ]; - - # exclude databases since they are covered separately - exclude = [ - "/var/lib/**/*.db" - "/var/lib/**/*.db-shm" - "/var/lib/**/*.db-wal" - "/var/lib/**/*.sqlite3" - "/var/lib/**/*.sqlite3-shm" - "/var/lib/**/*.sqlite3-wal" - - "/var/lib/vaultwarden/sends/*" - "/var/lib/vaultwarden/tmp/*" - ]; + environmentFile = config.sops.secrets."restic/rest-auth.env".path; + passwordFile = config.sops.secrets."restic/password".path; + timerConfig = { + OnCalendar = "03:00"; + Persistent = true; }; -# offsite = { -# initialize = true; -# repository = "rclone:protondrive:restic"; -# passwordFile = config.sops.secrets."restic/password".path; -# timerConfig = { -# OnCalendar = "3:05"; -# Persistent = true; -# }; -# rcloneOptions = { protondrive-replace-existing-draft = true; }; -# rcloneConfigFile = config.sops.secrets."restic/rclone/offsite".path; + repository = "rest:http://localhost:8001/drone"; + initialize = true; -# paths = config.services.restic.backups.main.paths; -# exclude = config.services.restic.backups.main.exclude; + paths = [ + "/var/lib/jellyfin" + "/var/lib/vaultwarden" + "/var/backups/db-backup" + ]; -# backupCleanupCommand = "rm -r /var/backups/db-backup/*"; -# }; + # exclude databases since they are covered separately + exclude = [ + "/var/lib/**/*.db" + "/var/lib/**/*.db-shm" + "/var/lib/**/*.db-wal" + "/var/lib/**/*.sqlite3" + "/var/lib/**/*.sqlite3-shm" + "/var/lib/**/*.sqlite3-wal" + + "/var/lib/vaultwarden/sends/*" + "/var/lib/vaultwarden/tmp/*" + ]; }; }