mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
fix(lib): mkSecretOption fix defaults
This commit is contained in:
parent
73b1713fd0
commit
dcbb4ce2bb
1 changed files with 4 additions and 2 deletions
6
lib.nix
6
lib.nix
|
|
@ -50,15 +50,17 @@ rec {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
description = "Name of the secret where secret is stored";
|
description = "Name of the secret where secret is stored";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
} // optionalAttrs (hasAttr "default" options && options.default != null && hasAttr "name" options.default) {
|
||||||
|
default = options.default.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
key = mkOption {
|
key = mkOption {
|
||||||
description = "Name of the key where secret is stored";
|
description = "Name of the key where secret is stored";
|
||||||
type = types.str;
|
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 {
|
apply = value: if value == null then null else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue