49 lines
954 B
Nix
Raw Normal View History

# unpackPhase
# patchPhase
# configurePhase
# buildPhase
# checkPhase
# installPhase
# fixupPhase
# installCheckPhase
# distPhase
{
lib,
pkgs,
stdenv,
kubernetes-helm,
helm_src,
helm_name,
helm_namespace,
helm_path ? ".",
helm_manifest_name,
helm_values ? { },
...
}:
stdenv.mkDerivation (
finalAttrs:
let
to_yaml_file = ((import ../../../functions/to_yaml.nix) { inherit pkgs; }).to_yaml_file;
in
{
name = "${helm_name}-manifest";
nativeBuildInputs = [
kubernetes-helm
];
buildInputs = [ ];
src = helm_src;
buildPhase = ''
helm template --dry-run=client ${lib.strings.escapeShellArg helm_name} $src/${helm_path} --namespace ${helm_namespace} \
--values ${to_yaml_file "values.yaml" helm_values} \
| tee $NIX_BUILD_TOP/${helm_manifest_name}
'';
installPhase = ''
mkdir -p "$out"
cp $NIX_BUILD_TOP/${helm_manifest_name} $out/
'';
}
)