3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/helm/default.nix
2017-05-15 14:06:19 -04:00

47 lines
1.1 KiB
Nix

{ stdenv, fetchurl, kubernetes }:
let
arch = if stdenv.isLinux
then "linux-amd64"
else "darwin-amd64";
checksum = if stdenv.isLinux
then "0vjkcilxzwvkgcczcbq58nl2j17ddqiysxm5yl13agnmxzvxw6r2"
else "1ga9gxzji48vhbaa0pkxd03h89zgjsbikbki9xla1qbvyvqjnw5g";
pname = "helm";
version = "2.4.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 = [ kubernetes ];
phases = [ "buildPhase" "installPhase" ];
buildPhase = ''
mkdir -p $out/bin
'';
installPhase = ''
tar -xvzf $src
cp ${arch}/helm $out/bin/${pname}
chmod +x $out/bin/${pname}
'';
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;
};
}