2022-03-30 09:31:56 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, makeWrapper, gawk, glibc, fetchzip }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "vault-bin";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.13.2";
|
2022-03-30 09:31:56 +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 {
|
2023-05-24 13:37:59 +00:00
|
|
|
x86_64-linux = "sha256-RVqhObAw1M4zNK5cXzbD+cbITtsUPBXoc7O7zqVRJhI=";
|
|
|
|
aarch64-linux = "sha256-WLw6GKNZc5a7HGTAI4kzsel8N9EwoTWda7Z05pXNeDA=";
|
|
|
|
i686-linux = "sha256-v1f5yDrarKmWFtL9fIr03H5tH/bDi83XVYsTnLgLq5Q=";
|
|
|
|
x86_64-darwin = "sha256-f1f6KFgr/A62PxEZEzzkNkQF4YI/xISYKVczcXn3r0k=";
|
|
|
|
aarch64-darwin = "sha256-TQ9Wi6rBXWCYBkkvCyoMMbRiUOEBykvbwp6hdqUUO4I=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
fetchzip {
|
|
|
|
url = "https://releases.hashicorp.com/vault/${version}/vault_${version}_${suffix}.zip";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
dontStrip = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-03-20 04:20:00 +00:00
|
|
|
runHook preInstall
|
2022-03-30 09:31:56 +00:00
|
|
|
install -D vault $out/bin/vault
|
2021-03-20 04:20:00 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +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-06 16:07:01 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A tool for managing secrets, this binary includes the UI";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://www.vaultproject.io";
|
2022-07-14 12:49:19 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mpl20;
|
2022-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; teams.serokell.members ++ [ offline psyanticy Chili-Man techknowlogick mkaito ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "vault";
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|