From a0ead301947eacfb7e2a6795121cfd87e99e4675 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 17 Jan 2022 21:57:00 +0100 Subject: [PATCH] services: restic: support custom secret filepaths --- services/restic-backup.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/services/restic-backup.nix b/services/restic-backup.nix index a4ee271..624deca 100644 --- a/services/restic-backup.nix +++ b/services/restic-backup.nix @@ -62,6 +62,16 @@ in { monthly = 6; }; }; + + passwordFile = mkOption { + type = types.str; + default = "/root/restic/password"; + }; + + environmentFile = mkOption { + type = types.str; + default = "/root/restic/creds"; + }; }; config = mkIf cfg.enable { @@ -73,8 +83,8 @@ in { paths = cfg.paths; repository = cfg.repo; - passwordFile = "/root/restic/password"; - environmentFile = "/root/restic/creds"; + passwordFile = cfg.passwordFile; + environmentFile = cfg.environmentFile; extraBackupArgs = [ "--verbose=2" ] ++ optional (builtins.length cfg.exclude != 0) excludeArg;