5083ee08a2
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
63 lines
2 KiB
Nix
63 lines
2 KiB
Nix
{ lib, stdenv, fetchurl, unzip, makeWrapper, gawk, glibc, fetchzip }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "vault-bin";
|
|
version = "1.11.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-+txLeWsk63rj1iWOI3p9oP2aAEY/VYbvMOYtGQ6gHV8=";
|
|
aarch64-linux = "sha256-py8HF4uydQIIW1zu5W2c1VF6Dtp4yw+hUs8fPjIa7YQ=";
|
|
i686-linux = "sha256-87dmhr2HEBqjPDd4SrVGH5Fw7Rar9HqWxNRMK8Vg9yY=";
|
|
x86_64-darwin = "sha256-AsVYI5uM9b5NIaf0Qkb5/zbJ0WYxROBIa0nvbX08OcI=";
|
|
aarch64-darwin = "sha256-2Fqk5C9who8tV7+OnVODcK5DyJjE6V5akIR4oNhDQlA=";
|
|
};
|
|
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.mpl20;
|
|
maintainers = with maintainers; teams.serokell.members ++ [ offline psyanticy Chili-Man techknowlogick ];
|
|
mainProgram = "vault";
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
|
|
};
|
|
}
|