2021-07-28 20:57:42 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, buildGoModule, installShellFiles, nixosTests
|
2021-06-28 23:22:31 +02:00
|
|
|
, makeWrapper
|
|
|
|
, gawk
|
|
|
|
, glibc
|
|
|
|
}:
|
2016-06-04 23:13:30 +02:00
|
|
|
|
2021-07-28 20:57:42 +02:00
|
|
|
buildGoModule rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "vault";
|
2021-12-22 09:05:51 +01:00
|
|
|
version = "1.9.2";
|
2016-06-04 23:13:30 +02:00
|
|
|
|
2016-06-06 12:56:28 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hashicorp";
|
|
|
|
repo = "vault";
|
2016-09-23 19:34:51 +02:00
|
|
|
rev = "v${version}";
|
2021-12-22 09:05:51 +01:00
|
|
|
sha256 = "sha256-vuwVPBB7zxpmJsBZ+J/vl0E49gx7CUGGi5j1Grgv2Jo=";
|
2016-09-23 19:34:51 +02:00
|
|
|
};
|
|
|
|
|
2021-12-22 09:05:51 +01:00
|
|
|
vendorSha256 = "sha256-OHGQ6v51jfxEhe7v8b9/yh7aPZmgTod+WFKFzwXk4LU=";
|
2019-09-21 11:32:00 +02:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2017-06-29 04:02:13 +02:00
|
|
|
|
2021-06-28 23:22:31 +02:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2020-04-26 05:16:57 +02:00
|
|
|
|
2021-08-06 02:58:02 +02:00
|
|
|
tags = [ "vault" ];
|
2021-07-28 20:57:52 +02: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="
|
|
|
|
];
|
2017-07-02 02:39:55 +02:00
|
|
|
|
2019-08-28 09:47:03 +02:00
|
|
|
postInstall = ''
|
2020-04-28 03:50:57 +02:00
|
|
|
echo "complete -C $out/bin/vault vault" > vault.bash
|
2020-04-26 05:16:57 +02:00
|
|
|
installShellCompletion vault.bash
|
2021-07-06 16:58:17 +02:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2021-06-28 23:22:31 +02:00
|
|
|
wrapProgram $out/bin/vault \
|
|
|
|
--prefix PATH ${lib.makeBinPath [ gawk glibc ]}
|
2016-12-11 14:59:14 +01:00
|
|
|
'';
|
|
|
|
|
2021-12-04 21:34:52 +01:00
|
|
|
passthru.tests = { inherit (nixosTests) vault vault-postgresql; };
|
2020-11-02 05:20:00 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|