1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2025-03-05 08:07:16 +00:00

HM: make secretsMountPoint and symlinkPath configurable

This commit is contained in:
MidAutumnMoon 2023-03-20 22:55:10 +08:00 committed by Shawn8901
parent de6514f8fe
commit 37400a275d

View file

@ -25,7 +25,7 @@ let
path = lib.mkOption {
type = lib.types.str;
default = "%r/secrets/${name}";
default = "${cfg.defaultSymlinkPath}/${name}";
description = ''
Path where secrets are symlinked to.
If the default is kept no other symlink is created.
@ -66,8 +66,8 @@ let
name = "manifest${suffix}.json";
text = builtins.toJSON {
secrets = builtins.attrValues secrets;
secretsMountPoint = "%r/secrets.d";
symlinkPath = "%r/secrets";
secretsMountPoint = cfg.defaultSecretsMountPoint;
symlinkPath = cfg.defaultSymlinkPath;
keepGenerations = cfg.keepGenerations;
gnupgHome = cfg.gnupg.home;
sshKeyPaths = cfg.gnupg.sshKeyPaths;
@ -133,6 +133,23 @@ in {
'';
};
defaultSymlinkPath = lib.mkOption {
type = lib.types.str;
default = "%r/secrets";
description = ''
Default place where the latest generation of decrypt secrets
can be found.
'';
};
defaultSecretsMountPoint = lib.mkOption {
type = lib.types.str;
default = "%r/secrets.d";
description = ''
Default place where generations of decrypted secrets are stored.
'';
};
keepGenerations = lib.mkOption {
type = lib.types.ints.unsigned;
default = 1;