2019-07-24 11:02:10 +01:00
|
|
|
{ stdenv, fetchurl, unzip }:
|
|
|
|
|
|
|
|
let
|
2019-11-25 16:23:59 +00:00
|
|
|
version = "1.3.0";
|
2019-07-24 11:02:10 +01:00
|
|
|
|
2019-08-04 11:20:16 +01:00
|
|
|
sources = let
|
2019-07-24 11:02:10 +01:00
|
|
|
base = "https://releases.hashicorp.com/vault/${version}";
|
|
|
|
in {
|
2019-08-13 22:52:01 +01:00
|
|
|
x86_64-linux = fetchurl {
|
2019-07-24 11:02:10 +01:00
|
|
|
url = "${base}/vault_${version}_linux_amd64.zip";
|
2019-11-25 16:23:59 +00:00
|
|
|
sha256 = "1crfj4gd1qwwa2xidd0pjffv0n6hf5hbhv6568m6zc1ig0qqm6yq";
|
2019-07-24 11:02:10 +01:00
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
i686-linux = fetchurl {
|
2019-07-24 11:02:10 +01:00
|
|
|
url = "${base}/vault_${version}_linux_386.zip";
|
2019-11-25 16:23:59 +00:00
|
|
|
sha256 = "0pyf0kyvxpmx3fwfvin1r0x30r9byx9lyi81894q06xrhiwbqc0l";
|
2019-07-24 11:02:10 +01:00
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
x86_64-darwin = fetchurl {
|
2019-07-24 11:02:10 +01:00
|
|
|
url = "${base}/vault_${version}_darwin_amd64.zip";
|
2019-11-25 16:23:59 +00:00
|
|
|
sha256 = "113vnpz9n6y7z2k9jqpfpxqxqbrmd9bhny79yaxqzkfdqw8vyv3g";
|
2019-07-24 11:02:10 +01:00
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
i686-darwin = fetchurl {
|
2019-07-24 11:02:10 +01:00
|
|
|
url = "${base}/vault_${version}_darwin_386.zip";
|
2019-11-25 16:23:59 +00:00
|
|
|
sha256 = "0d191qai0bpl7cyivca26wqgycsj2dz08809z147d1vnrz321v6w";
|
2019-07-24 11:02:10 +01:00
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
aarch64-linux = fetchurl {
|
2019-07-24 11:02:10 +01:00
|
|
|
url = "${base}/vault_${version}_linux_arm64.zip";
|
2019-11-25 16:23:59 +00:00
|
|
|
sha256 = "1bk5y3knc42mh07gnnn6p109qz908014620h1s0348wp4qfdy49w";
|
2019-07-24 11:02:10 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-08-04 11:20:16 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "vault-bin";
|
|
|
|
inherit version;
|
2019-07-24 11:02:10 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
src = sources.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}");
|
2019-07-24 11:02:10 +01:00
|
|
|
|
2019-08-04 11:20:16 +01:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2019-07-24 11:02:10 +01:00
|
|
|
|
2019-08-04 11:20:16 +01:00
|
|
|
sourceRoot = ".";
|
2019-07-24 11:02:10 +01:00
|
|
|
|
2019-08-04 11:20:16 +01:00
|
|
|
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
|
|
|
|
'';
|
2019-07-24 11:02:10 +01:00
|
|
|
|
2019-08-04 11:20:16 +01:00
|
|
|
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;
|
2019-11-25 16:23:59 +00:00
|
|
|
maintainers = with maintainers; [ offline psyanticy mkaito ];
|
2019-08-04 11:20:16 +01:00
|
|
|
};
|
|
|
|
}
|