mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-13 16:40:05 +01:00
refator: put all modules under modules directory
This commit is contained in:
parent
e3b788c5dc
commit
da12e2a319
32 changed files with 148 additions and 580739 deletions
35
modules/k8s/lib.nix
Normal file
35
modules/k8s/lib.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
k8s = {
|
||||
mkSecretOption = {description ? "", default ? null}: mkOption {
|
||||
inherit description;
|
||||
type = types.nullOr (types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
description = "Name of the secret where secret is stored";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
key = mkOption {
|
||||
description = "Name of the key where secret is stored";
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkDefault (if default == null then {} else default);
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
|
||||
secretToEnv = value: {
|
||||
valueFrom.secretKeyRef = {
|
||||
inherit (value) name key;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
_module.args.k8s = k8s;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue