fix(lib): mkSecretOption allow to pass null

This commit is contained in:
Jaka Hudoklin 2017-12-18 12:33:16 +01:00
parent e682e31dcf
commit 73b1713fd0
2 changed files with 7 additions and 9 deletions

View file

@ -57,16 +57,16 @@ rec {
type = types.str;
};
};
config = mkIf (hasAttr "default" options) (mkAllDefault options.default 1000);
} // optionalAttrs (hasAttr "default" options && options.default != null) {
config = mkAllDefault options.default 1000;
});
apply = value: {
apply = value: if value == null then null else {
valueFrom.secretKeyRef = {
inherit (value) name key;
};
};
default = {};
default = null;
});
}