vault-bin: use sourceRoot instead of custom unpackPhase

This commit is contained in:
Jaka Hudoklin
2019-08-04 12:20:16 +02:00
parent f403684eee
commit 558cdf0e11
+19 -23
View File
@@ -1,12 +1,10 @@
{ stdenv, fetchurl, unzip }: { stdenv, fetchurl, unzip }:
let let
version = "1.1.3"; version = "1.1.3";
sources = let sources = let
base = "https://releases.hashicorp.com/vault/${version}"; base = "https://releases.hashicorp.com/vault/${version}";
in { in {
"x86_64-linux" = fetchurl { "x86_64-linux" = fetchurl {
url = "${base}/vault_${version}_linux_amd64.zip"; url = "${base}/vault_${version}_linux_amd64.zip";
@@ -30,28 +28,26 @@ let
}; };
}; };
in in stdenv.mkDerivation {
stdenv.mkDerivation { name = "vault-bin-${version}";
src = sources."${stdenv.hostPlatform.system}" or (throw "unsupported system: ${stdenv.hostPlatform.system}"); src = sources."${stdenv.hostPlatform.system}" or (throw "unsupported system: ${stdenv.hostPlatform.system}");
name = "vault-bin-${version}"; nativeBuildInputs = [ unzip ];
nativeBuildInputs = [ unzip ]; sourceRoot = ".";
unpackPhase = "unzip $src -d vault"; installPhase = ''
mkdir -p $out/bin $out/share/bash-completion/completions
mv vault $out/bin
echo "complete -C $out/bin/vault vault" > $out/share/bash-completion/completions/vault
'';
installPhase = '' meta = with stdenv.lib; {
mkdir -p $out/bin $out/share/bash-completion/completions homepage = https://www.vaultproject.io;
mv vault/vault $out/bin description = "A tool for managing secrets, this binary includes the UI";
echo "complete -C $out/bin/vault vault" > $out/share/bash-completion/completions/vault platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "i686-darwin" ];
''; license = licenses.mpl20;
maintainers = with maintainers; [ offline psyanticy ];
meta = with stdenv.lib; { };
homepage = https://www.vaultproject.io; }
description = "A tool for managing secrets, this binary includes the UI";
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "i686-darwin" ];
license = licenses.mpl20;
maintainers = with maintainers; [ offline psyanticy ];
};
}