summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/secret.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/3modules/secret.nix')
-rw-r--r--krebs/3modules/secret.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/krebs/3modules/secret.nix b/krebs/3modules/secret.nix
index 90c2f6a6d..c35dceba3 100644
--- a/krebs/3modules/secret.nix
+++ b/krebs/3modules/secret.nix
@@ -7,13 +7,17 @@ in {
default = toString <secrets>;
type = types.absolute-pathname;
};
- file = mkOption {
- default = relpath: "${cfg.directory}/${relpath}";
- readOnly = true;
- };
files = mkOption {
type = with pkgs.stockholm.lib.types; attrsOf secret-file;
default = {};
+ apply = mapAttrs (name: secret-file:
+ if types.absolute-pathname.check secret-file.source-path then
+ secret-file
+ else
+ secret-file // {
+ source-path = "${config.krebs.secret.directory}/secret-file.source-path";
+ }
+ );
};
};
config = lib.mkIf (cfg.files != {}) {