nixpkgs-suyu/pkgs/tools/security/vault/default.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

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