depot/third_party/nixpkgs/pkgs/tools/security/vault/vault-bin.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

63 lines
1.9 KiB
Nix

{ lib, stdenv, fetchzip }:
stdenv.mkDerivation rec {
pname = "vault-bin";
version = "1.15.4";
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 {
x86_64-linux = "sha256-E1tNqPkaZVnJXtV+ENt2Ajpdq0AYMPZSFMLAFiSxknY=";
aarch64-linux = "sha256-p+pYU4WenDHZmQQQFTm2ttHjxL+63NWy8G+cbAZLJEI=";
i686-linux = "sha256-FoClSgz/QAD7uktFcYmKsCXnS8kIm8a7BLd2N29Z/fE=";
x86_64-darwin = "sha256-Lykhs/tTFDBqk8SJ26k712oMUAhXlmBeNNi3Ve/M1B4=";
aarch64-darwin = "sha256-r9OamlIgFUGgIFX1baQCdBsDGmPwZoTVu+Zab99KnhM=";
};
in
fetchzip {
url = "https://releases.hashicorp.com/vault/${version}/vault_${version}_${suffix}.zip";
inherit sha256;
};
dontConfigure = true;
dontBuild = true;
dontStrip = stdenv.isDarwin;
installPhase = ''
runHook preInstall
install -D vault $out/bin/vault
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/vault --help
$out/bin/vault version
runHook postInstallCheck
'';
dontPatchELF = true;
dontPatchShebangs = true;
passthru.updateScript = ./update-bin.sh;
meta = with lib; {
description = "A tool for managing secrets, this binary includes the UI";
homepage = "https://www.vaultproject.io";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.bsl11;
maintainers = with maintainers; teams.serokell.members ++ [ offline psyanticy Chili-Man techknowlogick mkaito ];
mainProgram = "vault";
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
};
}