mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
Merge branch 'kubenix-2.0' of github.com:xtruder/kubenix into kubenix-2.0
This commit is contained in:
commit
ba26ce8e60
2 changed files with 8 additions and 5 deletions
12
lib/k8s.nix
12
lib/k8s.nix
|
|
@ -3,25 +3,27 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
mkSecretOption = {description ? "", default ? null}: mkOption {
|
mkSecretOption = {description ? "", default ? {}}: mkOption ({
|
||||||
inherit description;
|
inherit description;
|
||||||
type = types.nullOr (types.submodule {
|
type = types.nullOr (types.submodule {
|
||||||
options = {
|
options = {
|
||||||
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;
|
||||||
|
default = default.name or null;
|
||||||
};
|
};
|
||||||
|
|
||||||
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;
|
||||||
|
default = default.key or null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkDefault (if default == null then {} else default);
|
|
||||||
});
|
});
|
||||||
default = default;
|
default = {};
|
||||||
};
|
} // (optionalAttrs (default == null) {
|
||||||
|
default = null;
|
||||||
|
}));
|
||||||
|
|
||||||
secretToEnv = value: {
|
secretToEnv = value: {
|
||||||
valueFrom.secretKeyRef = {
|
valueFrom.secretKeyRef = {
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ let
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
default = [];
|
default = [];
|
||||||
|
apply = unique;
|
||||||
};
|
};
|
||||||
|
|
||||||
types = mkOption {
|
types = mkOption {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue