3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/security/vault/default.nix

53 lines
1.5 KiB
Nix
Raw Normal View History

2021-07-28 19:57:42 +01:00
{ stdenv, lib, fetchFromGitHub, buildGoModule, installShellFiles, nixosTests
, makeWrapper
, gawk
, glibc
}:
2016-06-04 22:13:30 +01:00
2021-07-28 19:57:42 +01:00
buildGoModule rec {
pname = "vault";
2021-07-28 19:57:42 +01:00
version = "1.8.0";
2016-06-04 22:13:30 +01:00
src = fetchFromGitHub {
owner = "hashicorp";
repo = "vault";
2016-09-23 18:34:51 +01:00
rev = "v${version}";
2021-07-28 19:57:42 +01:00
sha256 = "sha256-jyGymAplSe8vaSwbONtpRoAondxNBcRbFZ+YyOtr7qo=";
2016-09-23 18:34:51 +01:00
};
2021-07-28 19:57:42 +01:00
vendorSha256 = "11mrdf7pwf8v7bb7wamv2yhixw4x06rd0qym942kk9bwif2balfp";
2019-09-21 10:32:00 +01:00
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles makeWrapper ];
2020-04-26 04:16:57 +01:00
2021-07-28 19:57:42 +01:00
preBuild = ''
buildFlagsArray+=(
"-tags=vault"
"-ldflags=\
-s -w \
-X github.com/hashicorp/vault/sdk/version.GitCommit=${src.rev} \
-X github.com/hashicorp/vault/sdk/version.Version=${version} \
-X github.com/hashicorp/vault/sdk/version.VersionPrerelease=")
'';
postInstall = ''
echo "complete -C $out/bin/vault vault" > vault.bash
2020-04-26 04:16:57 +01:00
installShellCompletion vault.bash
'' + lib.optionalString stdenv.isLinux ''
wrapProgram $out/bin/vault \
--prefix PATH ${lib.makeBinPath [ gawk glibc ]}
2016-12-11 13:59:14 +00:00
'';
2020-11-02 04:20:00 +00:00
passthru.tests.vault = nixosTests.vault;
meta = with lib; {
2020-03-06 09:20:00 +00:00
homepage = "https://www.vaultproject.io/";
2016-09-23 18:34:51 +01:00
description = "A tool for managing secrets";
2020-11-21 04:20:00 +00:00
changelog = "https://github.com/hashicorp/vault/blob/v${version}/CHANGELOG.md";
2017-02-16 19:47:30 +00:00
platforms = platforms.linux ++ platforms.darwin;
2016-09-23 18:34:51 +01:00
license = licenses.mpl20;
2021-02-25 18:59:54 +00:00
maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri Chili-Man ];
2016-06-04 22:13:30 +01:00
};
}