Skip to content

Commit

Permalink
fix rustic module
Browse files Browse the repository at this point in the history
  • Loading branch information
AtaraxiaSjel committed Nov 11, 2024
1 parent 5c09791 commit fa55da2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
8 changes: 4 additions & 4 deletions machines/Home-Hypervisor/backups.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions machines/NixOS-VPS/services/backups.nix
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion modules/rustic-postgresql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions profiles/servers/minecraft.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fa55da2

Please sign in to comment.