default.nix (1184B)
1 { stdenv, lib, fetchurl }: 2 3 with lib; 4 rec { 5 kamGen = 6 { version 7 , sha256 8 }: 9 10 stdenv.mkDerivation rec { 11 pname = "kam"; 12 name = "${pname}-${version}"; 13 14 src = fetchurl { 15 url = "https://mirror.openshift.com/pub/openshift-v4/clients/kam/v${version}/kam-linux-amd64.tar.gz"; 16 sha256 = "${sha256}"; 17 }; 18 19 phases = " unpackPhase installPhase fixupPhase "; 20 21 unpackPhase = '' 22 runHook preUnpack 23 mkdir ${name} 24 tar -C ${name} -xzf $src 25 ''; 26 27 installPhase = '' 28 runHook preInstall 29 install -D ${name}/kam $out/bin/kam 30 patchelf \ 31 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 32 $out/bin/kam 33 # completions 34 mkdir -p $out/share/bash-completion/completions/ 35 $out/bin/kam completion bash > $out/share/bash-completion/completions/kam 36 mkdir -p $out/share/zsh/site-functions 37 $out/bin/kam completion zsh > $out/share/zsh/site-functions/_kam 38 ''; 39 }; 40 41 kam = kam_1_1; 42 kam_1_1 = makeOverridable kamGen { 43 version = "1.1.1"; 44 sha256 = "0cxf2n6y9arabq4ri3ni8v17vaflg9xqycmjwv2cm13bj4d7a1nq"; 45 }; 46 }