This commit is contained in:
David Arnold 2021-05-13 17:27:08 -04:00
parent c3fa598922
commit db6d83c61e
No known key found for this signature in database
GPG key ID: 6D6A936E69C59D08
53 changed files with 1916 additions and 1599 deletions

View file

@ -13,19 +13,22 @@ with lib;
, namespace ? null
# values to pass to chart
, values ? {}
, values ? { }
# kubernetes version to template chart for
, kubeVersion ? null }: let
, kubeVersion ? null
}:
let
valuesJsonFile = builtins.toFile "${name}-values.json" (builtins.toJSON values);
in stdenvNoCC.mkDerivation {
in
stdenvNoCC.mkDerivation {
name = "${name}.json";
buildCommand = ''
# template helm file and write resources to yaml
helm template "${name}" \
${optionalString (kubeVersion != null) "--api-versions ${kubeVersion}"} \
${optionalString (namespace != null) "--namespace ${namespace}"} \
${optionalString (values != {}) "-f ${valuesJsonFile}"} \
${optionalString (values != { }) "-f ${valuesJsonFile}"} \
${chart} >resources.yaml
# split multy yaml file into multiple files

View file

@ -1,9 +1,9 @@
{ stdenvNoCC, lib, kubernetes-helm, cacert }:
let
cleanName = name: lib.replaceStrings ["/"] ["-"] name;
cleanName = name: lib.replaceStrings [ "/" ] [ "-" ] name;
in {
in
{
# name of the chart
chart
@ -13,20 +13,21 @@ in {
# version of the chart
, version ? null
# chart hash
# chart hash
, sha256
# whether to extract chart
# whether to extract chart
, untar ? true
# use custom charts repo
# use custom charts repo
, repo ? null
# pass --verify to helm chart
# pass --verify to helm chart
, verify ? false
# pass --devel to helm chart
, devel ? false }: stdenvNoCC.mkDerivation {
# pass --devel to helm chart
, devel ? false
}: stdenvNoCC.mkDerivation {
name = "${cleanName chart}-${if version == null then "dev" else version}";
buildCommand = ''

View file

@ -1,9 +1,9 @@
{ pkgs ? import <nixpkgs> {} }:
{ pkgs ? import <nixpkgs> { } }:
let
fetchhelm = pkgs.callPackage ./fetchhelm.nix { };
chart2json = pkgs.callPackage ./chart2json.nix { };
in rec {
fetchhelm = pkgs.callPackage ./fetchhelm.nix { };
chart2json = pkgs.callPackage ./chart2json.nix { };
in
rec {
postgresql-chart = fetchhelm {
chart = "stable/postgresql";
version = "0.18.1";