From b6865e10bfa1260c3c143f2115d9f0ee45e2e5bc Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 7 Oct 2024 20:30:27 +0200 Subject: [PATCH] Improve restic extraConfig handling --- modules/system/restic-backup.nix | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/system/restic-backup.nix b/modules/system/restic-backup.nix index 7c1a824..f673da0 100644 --- a/modules/system/restic-backup.nix +++ b/modules/system/restic-backup.nix @@ -61,21 +61,23 @@ in services.restic.backups = lib.mapAttrs ( name: value: - { - inherit (value) user; - initialize = true; - repository = "s3:https://s3.eu-central-003.backblazeb2.com/stork-atlas/${name}"; - environmentFile = - config.sops.secrets."restic/environment".path or "/run/secrets/restic/environment"; - passwordFile = config.sops.secrets."restic/password".path or "/run/secrets/restic/password"; - pruneOpts = [ - "--keep-daily 7" - "--keep-weekly 5" - "--keep-monthly 6" - "--keep-yearly 1" - ]; - } - // value.extraConfig + lib.mkMerge [ + { + inherit (value) user; + initialize = true; + repository = "s3:https://s3.eu-central-003.backblazeb2.com/stork-atlas/${name}"; + environmentFile = + config.sops.secrets."restic/environment".path or "/run/secrets/restic/environment"; + passwordFile = config.sops.secrets."restic/password".path or "/run/secrets/restic/password"; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 5" + "--keep-monthly 6" + "--keep-yearly 1" + ]; + } + value.extraConfig + ] ) cfg; systemd.services = lib.mkMerge [