diff --git a/lib/helm.nix b/lib/helm.nix index 23f4514..19a84e7 100644 --- a/lib/helm.nix +++ b/lib/helm.nix @@ -47,32 +47,4 @@ # Derivation containing helm chart. Usually output of [lib.helm.downloadHelmChart](#libhelmdownloadhelmchart). chart: lib.head (klib.fromYAML (builtins.readFile "${chart}/values.yaml")); - - mkHelmApplication = { - name, - namespace, - chart, - values ? {}, - extrasGenerator ? _: {}, - }: let - chartValues = lib.head (klib.fromYAML (builtins.readFile "${chart}/values.yaml")); - finalValues = lib.attrsets.recursiveUpdate chartValues values; - extras = extrasGenerator { - inherit namespace; - values = finalValues; - }; - - rendered = lib.resources.fromHelmChart { - inherit chart name namespace values; - }; - - merged = lib.mkMerge [ - rendered - (extras.resources or {}) - (lib.resources.fromManifestYAMLs (extras.YAMLs or [])) - ]; - in { - inherit namespace; - resources = merged; - }; } diff --git a/lib/kube.nix b/lib/kube.nix index 30c95e7..2f28793 100644 --- a/lib/kube.nix +++ b/lib/kube.nix @@ -2,9 +2,7 @@ lib, klib, ... -}: let - mkManifest = manifest: lib.filterAttrsRecursive (_: v: v != null) manifest; -in { +}: { /* Parses a YAML document string into a list of attribute sets. diff --git a/lib/kustomize.nix b/lib/kustomize.nix index dac2830..82d3247 100644 --- a/lib/kustomize.nix +++ b/lib/kustomize.nix @@ -51,28 +51,4 @@ ${pkgs.kubectl}/bin/kubectl kustomize "${sanitizedPath}" -o "$out" ''; }; - - mkKustomizeApplication = { - name, - namespace, - kustomization, - path, - extrasGenerator ? _: {}, - }: let - extras = extrasGenerator {inherit namespace;}; - - rendered = lib.resources.fromKustomization { - inherit name namespace path; - src = kustomization; - }; - - merged = lib.mkMerge [ - rendered - (extras.resources or {}) - (lib.resources.fromManifestYAMLs (extras.YAMLs or [])) - ]; - in { - inherit namespace; - resources = merged; - }; }