2022-03-23 17:37:44 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, makeWrapper, gawk, glibc, fetchzip }:
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2022-03-23 17:37:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "vault-bin";
|
2022-04-25 18:14:54 +00:00
|
|
|
version = "1.10.1";
|
2022-03-23 17:37:44 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
let
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
selectSystem = attrs: attrs.${system} or (throw "Unsupported system: ${system}");
|
|
|
|
suffix = selectSystem {
|
|
|
|
x86_64-linux = "linux_amd64";
|
|
|
|
aarch64-linux = "linux_arm64";
|
|
|
|
i686-linux = "linux_386";
|
|
|
|
x86_64-darwin = "darwin_amd64";
|
|
|
|
aarch64-darwin = "darwin_arm64";
|
|
|
|
};
|
|
|
|
sha256 = selectSystem {
|
2022-04-25 18:14:54 +00:00
|
|
|
x86_64-linux = "sha256-8qrCGJNEWs3I/IRK1CiGfbbpQhwziFgoQyMcUX40wbw=";
|
|
|
|
aarch64-linux = "sha256-/rW39m2XnJp0MsBmXs4ktRnQriLdYHRJ9MIEtO9MxNk=";
|
|
|
|
i686-linux = "sha256-NHIxN3rdX+3yLjbh25c1IwB+Q/QRQCrIBF9XwxIwVpY=";
|
|
|
|
x86_64-darwin = "sha256-2OuJZftsP+fKInhBYlcRLZ1Rs+j/jl7Ve4M6Oz3Q7Ac=";
|
|
|
|
aarch64-darwin = "sha256-JSu8eS4jzRl8d8MOWnAgmvO68xGzxFRn8HW28gQbzmU=";
|
2022-03-23 17:37:44 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
fetchzip {
|
|
|
|
url = "https://releases.hashicorp.com/vault/${version}/vault_${version}_${suffix}.zip";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2022-03-23 17:37:44 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
dontStrip = stdenv.isDarwin;
|
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
|
2022-03-23 17:37:44 +00:00
|
|
|
install -D vault $out/bin/vault
|
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
|
|
|
|
2022-03-23 17:37:44 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
$out/bin/vault --help
|
|
|
|
$out/bin/vault version
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
|
|
|
passthru.updateScript = ./update-bin.sh;
|
2021-12-03 21:45: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";
|
2021-11-27 10:22:45 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
|
2019-08-04 10:20:16 +00:00
|
|
|
license = licenses.mpl20;
|
2022-03-23 17:37:44 +00:00
|
|
|
maintainers = with maintainers; teams.serokell.members ++ [ offline psyanticy Chili-Man techknowlogick ];
|
2019-08-04 10:20:16 +00:00
|
|
|
};
|
|
|
|
}
|