2021-08-05 21:33:18 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, buildGoModule, installShellFiles, nixosTests
|
2021-07-03 03:11:41 +00:00
|
|
|
, makeWrapper
|
|
|
|
, gawk
|
|
|
|
, glibc
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "vault";
|
2021-08-08 23:34:03 +00:00
|
|
|
version = "1.8.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hashicorp";
|
|
|
|
repo = "vault";
|
|
|
|
rev = "v${version}";
|
2021-08-08 23:34:03 +00:00
|
|
|
sha256 = "sha256-zBUUhHecf3jn9HSoydsKBQLXtfsVb56RbECg7zteZzc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
vendorSha256 = "sha256-uuzcDsi3f8KWE8WtN9v4jqmZPWsOm5I2LAbsyj1sjOY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2021-08-06 21:57:35 +00:00
|
|
|
tags = [ "vault" ];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
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="
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
echo "complete -C $out/bin/vault vault" > vault.bash
|
2020-05-03 17:38:23 +00:00
|
|
|
installShellCompletion vault.bash
|
2021-07-14 22:03:04 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2021-07-03 03:11:41 +00:00
|
|
|
wrapProgram $out/bin/vault \
|
|
|
|
--prefix PATH ${lib.makeBinPath [ gawk glibc ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
passthru.tests.vault = nixosTests.vault;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.vaultproject.io/";
|
|
|
|
description = "A tool for managing secrets";
|
2020-11-24 20:58:05 +00:00
|
|
|
changelog = "https://github.com/hashicorp/vault/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
license = licenses.mpl20;
|
2021-03-09 03:18:52 +00:00
|
|
|
maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri Chili-Man ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|