nixpkgs-suyu/pkgs/tools/security/vault/default.nix
Jonathan Ringer 08ab2d3c2a vault: wrap with gawk glibc
Binary will shell out awk and getent
2021-06-30 22:50:01 -07:00

44 lines
1.2 KiB
Nix

{ lib, fetchFromGitHub, buildGoPackage, installShellFiles, nixosTests
, makeWrapper
, gawk
, glibc
}:
buildGoPackage rec {
pname = "vault";
version = "1.7.3";
src = fetchFromGitHub {
owner = "hashicorp";
repo = "vault";
rev = "v${version}";
sha256 = "sha256-BO4xzZrX9eVETQWjBDBfP7TlD7sO+gLgbB330A11KAI=";
};
goPackagePath = "github.com/hashicorp/vault";
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles makeWrapper ];
buildFlagsArray = [ "-tags=vault" "-ldflags=-s -w -X ${goPackagePath}/sdk/version.GitCommit=${src.rev}" ];
postInstall = ''
echo "complete -C $out/bin/vault vault" > vault.bash
installShellCompletion vault.bash
wrapProgram $out/bin/vault \
--prefix PATH ${lib.makeBinPath [ gawk glibc ]}
'';
passthru.tests.vault = nixosTests.vault;
meta = with lib; {
homepage = "https://www.vaultproject.io/";
description = "A tool for managing secrets";
changelog = "https://github.com/hashicorp/vault/blob/v${version}/CHANGELOG.md";
platforms = platforms.linux ++ platforms.darwin;
license = licenses.mpl20;
maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri Chili-Man ];
};
}