services: restic: support custom secret filepaths

This commit is contained in:
Antoine Martin 2022-01-17 21:57:00 +01:00
parent c4fe135612
commit a0ead30194

View file

@ -62,6 +62,16 @@ in {
monthly = 6; monthly = 6;
}; };
}; };
passwordFile = mkOption {
type = types.str;
default = "/root/restic/password";
};
environmentFile = mkOption {
type = types.str;
default = "/root/restic/creds";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -73,8 +83,8 @@ in {
paths = cfg.paths; paths = cfg.paths;
repository = cfg.repo; repository = cfg.repo;
passwordFile = "/root/restic/password"; passwordFile = cfg.passwordFile;
environmentFile = "/root/restic/creds"; environmentFile = cfg.environmentFile;
extraBackupArgs = [ "--verbose=2" ] extraBackupArgs = [ "--verbose=2" ]
++ optional (builtins.length cfg.exclude != 0) excludeArg; ++ optional (builtins.length cfg.exclude != 0) excludeArg;