summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-09-11 15:31:13 +0200
committertv <tv@krebsco.de>2023-09-11 16:10:41 +0200
commit5370e0485788224126861e076110ac705013d2de (patch)
tree15838192c1ebf685733cbf39b3f3e37fd1ebd639 /krebs/3modules
parent8fc162ee3d9525a2b45346a1ca8f34ccb5ef971b (diff)
treewide: don't reference <secrets> explicitly
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/retiolum-bootstrap.nix4
-rw-r--r--krebs/3modules/secret.nix12
2 files changed, 10 insertions, 6 deletions
diff --git a/krebs/3modules/retiolum-bootstrap.nix b/krebs/3modules/retiolum-bootstrap.nix
index bd7e7c5f6..1e94df14e 100644
--- a/krebs/3modules/retiolum-bootstrap.nix
+++ b/krebs/3modules/retiolum-bootstrap.nix
@@ -22,8 +22,8 @@ in
default = "${config.krebs.secret.directory}/tinc.krebsco.de.key";
};
# in use:
- # <secrets/tinc.krebsco.de.crt>
- # <secrets/tinc.krebsco.de.key>
+ # ${config.krebs.secret.directory}/tinc.krebsco.de.crt
+ # ${config.krebs.secret.directory}/tinc.krebsco.de.key
};
config = mkIf cfg.enable {
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 != {}) {