Adding an extend example (helm+oci)
This commit is contained in:
parent
6f0834519e
commit
78894bd3b1
@ -10,9 +10,10 @@ let
|
||||
url,
|
||||
hash ? lib.fakeSha25,
|
||||
namespace ? "",
|
||||
patches ? []
|
||||
patches ? [],
|
||||
values ? ""
|
||||
}:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
inherit name patches;
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
@ -25,12 +26,14 @@ let
|
||||
"build"
|
||||
];
|
||||
|
||||
namespace = if namespace != "" then "--namespace ${namespace}" else "";
|
||||
namespaceOpts = if namespace != "" then "--namespace ${namespace}" else "";
|
||||
valuesOpts = if values != "" then "--values ${values}" else "";
|
||||
|
||||
build = ''
|
||||
mkdir -p $out
|
||||
${helm} template \
|
||||
--namespace ${namespace} \
|
||||
${namespaceOpts} \
|
||||
${valuesOpts} \
|
||||
${name} ./ > $out/${name}-${version}.yaml
|
||||
${helm} version > $out/VERSION
|
||||
'';
|
||||
|
14
poc-helm-oci/default.nix
Normal file
14
poc-helm-oci/default.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> {}
|
||||
, lib ? pkgs.lib
|
||||
, extend ? pkgs.extend
|
||||
}:
|
||||
let
|
||||
extendedAttrs = extend (final: prev: {
|
||||
localOutputs = {
|
||||
manifests = final.callPackage ./packages/manifests {};
|
||||
oci-image = final.callPackage ./packages/oci-image {};
|
||||
};
|
||||
});
|
||||
in
|
||||
extendedAttrs.localOutputs
|
20
poc-helm-oci/packages/manifests/default.nix
Normal file
20
poc-helm-oci/packages/manifests/default.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
pkgs
|
||||
, lib
|
||||
, helmnix ? import ../../../helm-poc/nix/helm.nix {}
|
||||
}:
|
||||
helmnix.mkHelm rec {
|
||||
name = "cert-manager";
|
||||
version = "v1.14.4";
|
||||
url = "https://charts.jetstack.io/charts/${name}-${version}.tgz";
|
||||
hash = "sha256-V3X9vBiB1uUQ33bTh1OvVLhr0Uyqjtso/bt5UnBC3t4=";
|
||||
values = ./../../values/cert-manager.yaml;
|
||||
}
|
||||
|
||||
#pkgs.dockerTools.streamLayeredImage {
|
||||
# name = "oci-image";
|
||||
# includeStorePaths = false;
|
||||
# fakeRootCommands = ''
|
||||
# cp -Lr ${localOutputs.charts}/* .
|
||||
# rm -fr nix
|
||||
# '';
|
18
poc-helm-oci/packages/oci-image/default.nix
Normal file
18
poc-helm-oci/packages/oci-image/default.nix
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
localOutputs,
|
||||
}:
|
||||
pkgs.dockerTools.streamLayeredImage {
|
||||
name = "oci-image";
|
||||
includeStorePaths = false;
|
||||
fakeRootCommands = ''
|
||||
cp -Lr ${localOutputs.manifests}/* .
|
||||
rm -fr nix
|
||||
'';
|
||||
|
||||
# config.Entrypoint = ["${lib.getExe localOutputs.binaries.simple-package}"];
|
||||
# contents = [
|
||||
# pkgs.hello
|
||||
# ];
|
||||
}
|
1
poc-helm-oci/values/cert-manager.yaml
Normal file
1
poc-helm-oci/values/cert-manager.yaml
Normal file
@ -0,0 +1 @@
|
||||
namespace: testaroo
|
Loading…
Reference in New Issue
Block a user