2023-07-12 18:27:24 +00:00
|
|
|
{ lib, stdenv, 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";
|
2024-09-26 02:16:06 +00:00
|
|
|
version = "1.17.6";
|
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";
|
|
|
|
};
|
2024-09-11 18:58:16 +00:00
|
|
|
hash = selectSystem {
|
2024-09-26 02:16:06 +00:00
|
|
|
x86_64-linux = "sha256-K9yNZ4M8u8FfisWi6Y6TsBJy6FQytr3htNCsKh2MlyA=";
|
|
|
|
aarch64-linux = "sha256-KLHkxUGvekHT/bPtoIlmylCubTWH+I7Q0wJM0UG0Hp8=";
|
|
|
|
i686-linux = "sha256-jBS/nGKP27weFw4u6Q10athYwCqWLzpb7ph39v+QAN8=";
|
|
|
|
x86_64-darwin = "sha256-5KfWqtJldk66dO5ImYKivDau4JzacUIXBfAzWkkPfoE=";
|
|
|
|
aarch64-darwin = "sha256-wjmNY1lunJDjpkWDXl0upAeNBqBx8momlY4a3j+hMd0=";
|
2022-03-23 17:37:44 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
fetchzip {
|
|
|
|
url = "https://releases.hashicorp.com/vault/${version}/vault_${version}_${suffix}.zip";
|
2024-09-11 18:58:16 +00:00
|
|
|
stripRoot=false;
|
|
|
|
inherit hash;
|
2022-03-23 17:37:44 +00:00
|
|
|
};
|
2019-07-24 10:02:10 +00:00
|
|
|
|
2022-03-23 17:37:44 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2024-09-24 15:50:49 +00:00
|
|
|
dontStrip = stdenv.hostPlatform.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; {
|
2019-08-04 10:20:16 +00:00
|
|
|
description = "Tool for managing secrets, this binary includes the UI";
|
2022-05-05 00:46:39 +00:00
|
|
|
homepage = "https://www.vaultproject.io";
|
2022-06-16 23:40:08 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2023-12-04 15:20:19 +00:00
|
|
|
license = licenses.bsl11;
|
2022-09-12 11:07:15 +00:00
|
|
|
maintainers = with maintainers; teams.serokell.members ++ [ offline psyanticy Chili-Man techknowlogick mkaito ];
|
2022-05-05 00:46:39 +00:00
|
|
|
mainProgram = "vault";
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
|
2019-08-04 10:20:16 +00:00
|
|
|
};
|
|
|
|
}
|