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

58 lines
1.8 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, unzip, makeWrapper, gawk, glibc }:
let
version = "1.8.4";
sources = let
base = "https://releases.hashicorp.com/vault/${version}";
in {
2019-08-13 21:52:01 +00:00
x86_64-linux = fetchurl {
url = "${base}/vault_${version}_linux_amd64.zip";
sha256 = "sha256-zrCRnIScIWJ8ocrgYPNhtvuX3PBLF9HX0dyZU/zY4yk=";
};
2019-08-13 21:52:01 +00:00
i686-linux = fetchurl {
url = "${base}/vault_${version}_linux_386.zip";
sha256 = "0sh9q29b0bi5ap6nvll0ykxd5vf4wliksj31cmm4gw5vp90irvl3";
};
2019-08-13 21:52:01 +00:00
x86_64-darwin = fetchurl {
url = "${base}/vault_${version}_darwin_amd64.zip";
sha256 = "09nhfdw20g46fnrn82my7a59pfa81dxncxhiswmha3cdy8n0p6wb";
};
2019-08-13 21:52:01 +00:00
aarch64-linux = fetchurl {
url = "${base}/vault_${version}_linux_arm64.zip";
sha256 = "01ra0xrgivf01ff87p0gqmi1flnac9y02x7jpv5j6a9czr1sqw1j";
};
};
in stdenv.mkDerivation {
2019-08-13 21:52:01 +00:00
pname = "vault-bin";
inherit version;
2019-08-13 21:52:01 +00:00
src = sources.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}");
nativeBuildInputs = [ makeWrapper unzip ];
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/bash-completion/completions
mv vault $out/bin
echo "complete -C $out/bin/vault vault" > $out/share/bash-completion/completions/vault
'' + lib.optionalString stdenv.isLinux ''
wrapProgram $out/bin/vault \
2021-07-28 21:12:59 +00:00
--prefix PATH : ${lib.makeBinPath [ gawk glibc ]}
runHook postInstall
'';
meta = with lib; {
homepage = "https://www.vaultproject.io";
description = "A tool for managing secrets, this binary includes the UI";
2020-11-21 04:20:00 +00:00
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
license = licenses.mpl20;
maintainers = with maintainers; teams.serokell.members ++ [ offline psyanticy Chili-Man ];
};
}