mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-15 17:50:52 +00:00
46 lines
815 B
Nix
46 lines
815 B
Nix
{
|
|
kubelib,
|
|
pkgs,
|
|
}: {
|
|
remoteYAMLFile = {
|
|
version,
|
|
url,
|
|
hash,
|
|
}:
|
|
pkgs.stdenv.mkDerivation {
|
|
pname = url;
|
|
inherit version;
|
|
|
|
src = pkgs.fetchurl {inherit url hash;};
|
|
|
|
phases = ["installPhase"];
|
|
installPhase = "cp -v $src $out";
|
|
};
|
|
|
|
helmChart = kubelib.downloadHelmChart;
|
|
|
|
gitChart = {
|
|
name,
|
|
version,
|
|
url,
|
|
hash,
|
|
chartPath,
|
|
vPrefixInRef ? false,
|
|
}:
|
|
pkgs.stdenv.mkDerivation {
|
|
pname = "${url}-${chartPath}";
|
|
inherit version;
|
|
|
|
src = pkgs.fetchgit {
|
|
inherit url hash;
|
|
rev =
|
|
if vPrefixInRef
|
|
then "v${version}"
|
|
else version;
|
|
sparseCheckout = [chartPath];
|
|
};
|
|
|
|
phases = ["installPhase"];
|
|
installPhase = "cp -rv $src/${chartPath} $out";
|
|
};
|
|
}
|