Improve restic extraConfig handling

This commit is contained in:
SebastianStork 2024-10-07 20:30:27 +02:00
parent a17ae8c58d
commit b6865e10bf

View file

@ -61,21 +61,23 @@ in
services.restic.backups = lib.mapAttrs ( services.restic.backups = lib.mapAttrs (
name: value: name: value:
{ lib.mkMerge [
inherit (value) user; {
initialize = true; inherit (value) user;
repository = "s3:https://s3.eu-central-003.backblazeb2.com/stork-atlas/${name}"; initialize = true;
environmentFile = repository = "s3:https://s3.eu-central-003.backblazeb2.com/stork-atlas/${name}";
config.sops.secrets."restic/environment".path or "/run/secrets/restic/environment"; environmentFile =
passwordFile = config.sops.secrets."restic/password".path or "/run/secrets/restic/password"; config.sops.secrets."restic/environment".path or "/run/secrets/restic/environment";
pruneOpts = [ passwordFile = config.sops.secrets."restic/password".path or "/run/secrets/restic/password";
"--keep-daily 7" pruneOpts = [
"--keep-weekly 5" "--keep-daily 7"
"--keep-monthly 6" "--keep-weekly 5"
"--keep-yearly 1" "--keep-monthly 6"
]; "--keep-yearly 1"
} ];
// value.extraConfig }
value.extraConfig
]
) cfg; ) cfg;
systemd.services = lib.mkMerge [ systemd.services = lib.mkMerge [