nixpkgs/pkgs/applications/networking/cluster/helm/default.nix
2017-01-13 22:48:36 +00:00

46 lines
1.1 KiB
Nix

{ stdenv, fetchurl, kubernetes }:
let
arch = if stdenv.isLinux
then "linux-amd64"
else "darwin-amd64";
checksum = if stdenv.isLinux
then "8bb6f9d336ca7913556e463c5b65eb8d69778c518df2fab0d20be943fbf0efc1"
else "94c9f2d511aec3d4b7dcc5f0ce6f846506169b4eb7235e1dc137d08edf408098";
in
stdenv.mkDerivation rec {
pname = "helm";
version = "2.1.3";
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;
};
}