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