diff --git a/machines/Home-Hypervisor/backups.nix b/machines/Home-Hypervisor/backups.nix index 34c19ec..d35ffcf 100644 --- a/machines/Home-Hypervisor/backups.nix +++ b/machines/Home-Hypervisor/backups.nix @@ -34,7 +34,7 @@ ignore-devid = true; group-by = "label"; skip-identical-parent = true; - glob = [ + globs = [ "!/media/nas/**/cache" "!/media/nas/**/.cache" "!/media/nas/**/log" @@ -45,12 +45,12 @@ "!/srv/gitea" "!/srv/wiki" ]; - sources = [{ - source = "/srv /media/nas/containers /media/nas/media-stack/configs"; + snapshots = [{ + sources = [ "/srv /media/nas/containers" "/media/nas/media-stack/configs" ]; }]; }; forget = { - filter-label = [ label ]; + filter-labels = [ label ]; group-by = "label"; prune = true; keep-daily = 4; diff --git a/machines/NixOS-VPS/services/backups.nix b/machines/NixOS-VPS/services/backups.nix index 0321c0d..98ee83e 100644 --- a/machines/NixOS-VPS/services/backups.nix +++ b/machines/NixOS-VPS/services/backups.nix @@ -1,5 +1,6 @@ -{ config, inputs, ... }: { +{ config, lib, inputs, ... }: { imports = [ inputs.ataraxiasjel-nur.nixosModules.rustic ]; + backups.postgresql.authentik.proxyAddress = lib.mkForce null; sops.secrets.rustic-vps-pass.sopsFile = inputs.self.secretsDir + /rustic.yaml; sops.secrets.rustic-backups-s3-env.sopsFile = inputs.self.secretsDir + /rustic.yaml; @@ -37,12 +38,12 @@ ignore-devid = true; group-by = "label"; skip-identical-parent = true; - sources = [{ - source = "/srv/marzban"; + snapshots = [{ + sources = [ "/srv/marzban" ]; }]; }; forget = { - filter-label = [ label ]; + filter-labels = [ label ]; group-by = "label"; prune = true; keep-daily = 4; diff --git a/modules/rustic-postgresql.nix b/modules/rustic-postgresql.nix index fc790fe..00bb4a5 100644 --- a/modules/rustic-postgresql.nix +++ b/modules/rustic-postgresql.nix @@ -41,6 +41,8 @@ with lib; Persistent = true; }; # Backup postgresql db and pass it to rustic through stdin + # Runs the next command: + # pg_dump ${dbName} | zstd --rsyncable --stdout - | rustic -P postgresql-authentik backup - backupCommandPrefix = "${config.services.postgresql.package}/bin/pg_dump ${backup.dbName} | ${pkgs.zstd}/bin/zstd --rsyncable --stdout - |"; extraBackupArgs = [ "-" ]; # Rustic profile yaml @@ -64,7 +66,7 @@ with lib; stdin-filename = "${backup.dbName}.dump.zst"; }; forget = { - filter-label = [ backup.dbName ]; + filter-labels = [ backup.dbName ]; group-by = "label"; prune = true; keep-daily = 4; diff --git a/profiles/servers/minecraft.nix b/profiles/servers/minecraft.nix index 8078054..cb5438d 100644 --- a/profiles/servers/minecraft.nix +++ b/profiles/servers/minecraft.nix @@ -148,14 +148,14 @@ in ignore-devid = true; group-by = "label"; skip-identical-parent = true; - glob = [ "!/var/lib/**/backups" "!/var/lib/**/.cache" "!/var/lib/**/logs" ]; + globs = [ "!/var/lib/**/backups" "!/var/lib/**/.cache" "!/var/lib/**/logs" ]; exclude-if-present = [ ".nobackup" "CACHEDIR.TAG" ]; - sources = [{ - source = lib.strings.concatStringsSep " " (map (x: "/var/lib/mc-${x}") (lib.attrNames instances)); + snapshots = [{ + sources = map (x: "/var/lib/mc-${x}") (lib.attrNames instances); }]; }; forget = { - filter-label = [ label ]; + filter-labels = [ label ]; group-by = "label"; prune = true; keep-hourly = 6;