2021-06-28 14:57:40 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, makeWrapper, gawk, glibc }:
|
2019-07-24 10:02:10 +00:00
|
|
|
|
|
|
|
let
|
2021-10-14 22:01:48 +00:00
|
|
|
version = "1.8.4";
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2019-08-04 10:20:16 +00:00
|
|
|
sources = let
|
2019-07-24 10:02:10 +00:00
|
|
|
base = "https://releases.hashicorp.com/vault/${version}";
|
|
|
|
in {
|
2019-08-13 21:52:01 +00:00
|
|
|
x86_64-linux = fetchurl {
|
2019-07-24 10:02:10 +00:00
|
|
|
url = "${base}/vault_${version}_linux_amd64.zip";
|
2021-10-14 22:01:48 +00:00
|
|
|
sha256 = "sha256-zrCRnIScIWJ8ocrgYPNhtvuX3PBLF9HX0dyZU/zY4yk=";
|
2019-07-24 10:02:10 +00:00
|
|
|
};
|
2019-08-13 21:52:01 +00:00
|
|
|
i686-linux = fetchurl {
|
2019-07-24 10:02:10 +00:00
|
|
|
url = "${base}/vault_${version}_linux_386.zip";
|
2021-10-14 22:01:48 +00:00
|
|
|
sha256 = "0sh9q29b0bi5ap6nvll0ykxd5vf4wliksj31cmm4gw5vp90irvl3";
|
2019-07-24 10:02:10 +00:00
|
|
|
};
|
2019-08-13 21:52:01 +00:00
|
|
|
x86_64-darwin = fetchurl {
|
2019-07-24 10:02:10 +00:00
|
|
|
url = "${base}/vault_${version}_darwin_amd64.zip";
|
2021-10-14 22:01:48 +00:00
|
|
|
sha256 = "09nhfdw20g46fnrn82my7a59pfa81dxncxhiswmha3cdy8n0p6wb";
|
2019-07-24 10:02:10 +00:00
|
|
|
};
|
2019-08-13 21:52:01 +00:00
|
|
|
aarch64-linux = fetchurl {
|
2019-07-24 10:02:10 +00:00
|
|
|
url = "${base}/vault_${version}_linux_arm64.zip";
|
2021-10-14 22:01:48 +00:00
|
|
|
sha256 = "01ra0xrgivf01ff87p0gqmi1flnac9y02x7jpv5j6a9czr1sqw1j";
|
2019-07-24 10:02:10 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-08-04 10:20:16 +00:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "vault-bin";
|
|
|
|
inherit version;
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
src = sources.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}");
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2021-06-28 14:57:40 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper unzip ];
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2019-08-04 10:20:16 +00:00
|
|
|
sourceRoot = ".";
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2019-08-04 10:20:16 +00:00
|
|
|
installPhase = ''
|
2021-03-25 14:48:15 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2019-08-04 10:20:16 +00:00
|
|
|
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
|
2021-07-06 14:58:17 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2021-06-28 14:57:40 +00:00
|
|
|
wrapProgram $out/bin/vault \
|
2021-07-28 21:12:59 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ gawk glibc ]}
|
|
|
|
|
2021-03-25 14:48:15 +00:00
|
|
|
runHook postInstall
|
2019-08-04 10:20:16 +00:00
|
|
|
'';
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.vaultproject.io";
|
2019-08-04 10:20:16 +00:00
|
|
|
description = "A tool for managing secrets, this binary includes the UI";
|
2020-11-21 04:20:00 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
|
2019-08-04 10:20:16 +00:00
|
|
|
license = licenses.mpl20;
|
2021-05-08 10:11:48 +00:00
|
|
|
maintainers = with maintainers; teams.serokell.members ++ [ offline psyanticy Chili-Man ];
|
2019-08-04 10:20:16 +00:00
|
|
|
};
|
|
|
|
}
|