From dcbb4ce2bb1b14c3a961c5a51fe087308da5f9da Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Mon, 18 Dec 2017 16:53:21 +0100 Subject: [PATCH] fix(lib): mkSecretOption fix defaults --- lib.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib.nix b/lib.nix index 18e57d6..7c12ab4 100644 --- a/lib.nix +++ b/lib.nix @@ -50,15 +50,17 @@ rec { name = mkOption { description = "Name of the secret where secret is stored"; type = types.str; + } // optionalAttrs (hasAttr "default" options && options.default != null && hasAttr "name" options.default) { + default = options.default.name; }; key = mkOption { description = "Name of the key where secret is stored"; type = types.str; + } // optionalAttrs (hasAttr "default" options && options.default != null && hasAttr "key" options.default) { + default = options.default.key; }; }; - } // optionalAttrs (hasAttr "default" options && options.default != null) { - config = mkAllDefault options.default 1000; }); apply = value: if value == null then null else {