2016-12-13 00:43:24 +01:00
|
|
|
{ stdenv, fetchurl, kubernetes }:
|
|
|
|
let
|
|
|
|
arch = if stdenv.isLinux
|
|
|
|
then "linux-amd64"
|
|
|
|
else "darwin-amd64";
|
|
|
|
checksum = if stdenv.isLinux
|
2017-07-07 14:39:19 +02:00
|
|
|
then "12dp2ggcjaqls4vrms21mvbphj8a8w156wmlqm19dppf6zsnxqxd"
|
|
|
|
else "1s3rhxfz663d255xc5ph6ndhb4x82baich8scyrgi84d7dxjx7mj";
|
2016-12-13 00:43:24 +01:00
|
|
|
pname = "helm";
|
2017-07-07 14:39:19 +02:00
|
|
|
version = "2.5.0";
|
2017-05-15 20:03:44 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2016-12-13 00:43:24 +01:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://kubernetes-helm.storage.googleapis.com/helm-v${version}-${arch}.tar.gz";
|
2017-05-15 20:03:44 +02:00
|
|
|
sha256 = checksum;
|
2016-12-13 00:43:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
buildInputs = [ ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ kubernetes ];
|
|
|
|
|
|
|
|
phases = [ "buildPhase" "installPhase" ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
tar -xvzf $src
|
|
|
|
cp ${arch}/helm $out/bin/${pname}
|
|
|
|
chmod +x $out/bin/${pname}
|
2017-05-23 01:14:10 +02:00
|
|
|
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
|
2016-12-13 00:43:24 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|