mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
Improve restic extraConfig handling
This commit is contained in:
parent
a17ae8c58d
commit
b6865e10bf
1 changed files with 17 additions and 15 deletions
|
|
@ -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 [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue