2018-01-22 01:40:21 +00:00
|
|
|
{ stdenv, fetchurl, kubectl }:
|
2016-12-12 23:43:24 +00:00
|
|
|
let
|
2018-03-15 12:52:55 +00:00
|
|
|
isLinux = stdenv.isLinux;
|
|
|
|
arch = if isLinux
|
2016-12-12 23:43:24 +00:00
|
|
|
then "linux-amd64"
|
|
|
|
else "darwin-amd64";
|
2018-03-15 12:52:55 +00:00
|
|
|
checksum = if isLinux
|
2018-10-04 20:44:03 +01:00
|
|
|
then "18bk4zqdxdrdcl34qay5mpzzywy9srmpz3mm91l0za6nhqapb902"
|
|
|
|
else "03xb73769awc6dpvz86nqm9fbgp3yrw30kf5lphf76klk2ii66sm";
|
2016-12-12 23:43:24 +00:00
|
|
|
pname = "helm";
|
2018-10-04 20:44:03 +01:00
|
|
|
version = "2.11.0";
|
2017-05-15 19:03:44 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2016-12-12 23:43:24 +00:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://kubernetes-helm.storage.googleapis.com/helm-v${version}-${arch}.tar.gz";
|
2017-05-15 19:03:44 +01:00
|
|
|
sha256 = checksum;
|
2016-12-12 23:43:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
buildInputs = [ ];
|
|
|
|
|
2018-01-22 01:40:21 +00:00
|
|
|
propagatedBuildInputs = [ kubectl ];
|
2016-12-12 23:43:24 +00:00
|
|
|
|
|
|
|
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 00:14:10 +01: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-12 23:43:24 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/kubernetes/helm;
|
|
|
|
description = "A package manager for kubernetes";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.rlupton20 ];
|
2018-06-17 20:31:18 +01:00
|
|
|
platforms = [ "x86_64-linux" ] ++ platforms.darwin;
|
2016-12-12 23:43:24 +00:00
|
|
|
};
|
|
|
|
}
|