Initial refactoring for kubenix 2.0

Implemented features:

- Improved and reimplemented submodule system, independent of
kubernetes module definitions
- Pre-generated kubernetes module definitions with explicit API
versioning support
This commit is contained in:
Jaka Hudoklin 2019-02-10 21:03:47 +01:00
parent 7287c4ed9e
commit 3dc1e615c4
No known key found for this signature in database
GPG key ID: 6A08896BFD32BD95
20 changed files with 207916 additions and 751 deletions

35
k8s/lib.nix Normal file
View file

@ -0,0 +1,35 @@
{ lib, ... }:
with lib;
let
k8s = {
mkSecretOption = {description ? "", default ? {}}: 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 default;
});
default = {};
};
secretToEnv = value: {
valueFrom.secretKeyRef = {
inherit (value) name key;
};
};
};
in {
_module.args.k8s = k8s;
}