nixpkgs/pkgs/tools/security/vault/vault-bin.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchzip }:
2022-03-23 17:37:44 +00:00
stdenv.mkDerivation rec {
2019-08-13 21:52:01 +00:00
pname = "vault-bin";
2023-11-15 06:23:00 +00:00
version = "1.15.2";
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 {
2023-11-15 06:23:00 +00:00
x86_64-linux = "sha256-aawDrQu8wEZqJ/uyCJjtWcgy8Ut34B5P+odqddE5P3M=";
aarch64-linux = "sha256-thLVw//yIgPCAV9CdrRlINLg+cO5aB279I2aboZMF6w=";
i686-linux = "sha256-bUhtnQB5YZdDuB4uondln0D3itoTr+1FaqjgTiT76WA=";
x86_64-darwin = "sha256-+wZrWwbpibtCla1ydhDnLJsHrVymLzEXVE1KftZ+pOs=";
aarch64-darwin = "sha256-2FGiCzIAEyXTqRaKEDZK5d/PWl4EmvJl9NieiOdgOeY=";
2022-03-23 17:37:44 +00:00
};
in
fetchzip {
url = "https://releases.hashicorp.com/vault/${version}/vault_${version}_${suffix}.zip";
inherit sha256;
};
2022-03-23 17:37:44 +00:00
dontConfigure = true;
dontBuild = true;
dontStrip = stdenv.isDarwin;
installPhase = ''
runHook preInstall
2022-03-23 17:37:44 +00:00
install -D vault $out/bin/vault
runHook postInstall
'';
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;
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 mkaito ];
mainProgram = "vault";
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
};
}