mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 00:25:24 +00:00
50 lines
1.3 KiB
Nix
50 lines
1.3 KiB
Nix
{ stdenv, fetchurl, kubectl }:
|
|
let
|
|
arch = if stdenv.isLinux
|
|
then "linux-amd64"
|
|
else "darwin-amd64";
|
|
checksum = if stdenv.isLinux
|
|
then "07bgny8mfdgv9f6zmk31hxhkwy90wr22js21jz679pkz3gmykxvx"
|
|
else "1f6h96gyhsdb03am586kdqn619h4niwlj29j4bypf3yg2sar4p6x";
|
|
pname = "helm";
|
|
version = "2.8.1";
|
|
in
|
|
stdenv.mkDerivation {
|
|
name = "${pname}-${version}";
|
|
|
|
src = fetchurl {
|
|
url = "https://kubernetes-helm.storage.googleapis.com/helm-v${version}-${arch}.tar.gz";
|
|
sha256 = checksum;
|
|
};
|
|
|
|
preferLocalBuild = true;
|
|
|
|
buildInputs = [ ];
|
|
|
|
propagatedBuildInputs = [ kubectl ];
|
|
|
|
phases = [ "buildPhase" "installPhase" ];
|
|
|
|
buildPhase = ''
|
|
mkdir -p $out/bin
|
|
'';
|
|
|
|
installPhase = ''
|
|
tar -xvzf $src
|
|
cp ${arch}/helm $out/bin/${pname}
|
|
chmod +x $out/bin/${pname}
|
|
mkdir -p $out/share/bash-completion/completions
|
|
mkdir -p $out/share/zsh/site-functions
|
|
$out/bin/helm completion bash > $out/share/bash-completion/completions/helm
|
|
$out/bin/helm completion zsh > $out/share/zsh/site-functions/_helm
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
homepage = https://github.com/kubernetes/helm;
|
|
description = "A package manager for kubernetes";
|
|
license = licenses.asl20;
|
|
maintainers = [ maintainers.rlupton20 ];
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
};
|
|
}
|