nixpkgs/pkgs/applications/networking/cluster/helm/default.nix
2017-03-22 21:34:29 +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 "fa434644d1afd92637369a033fd65b717d8dfa910127d335e8a82c8fad74cc35"
else "64420d467e03ceb666a4f22b89e08b93c06f76f5917fe539860b04cd5e5e515f";
in
stdenv.mkDerivation rec {
pname = "helm";
version = "2.2.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;
};
}