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";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.14.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hashicorp";
|
|
|
|
repo = "vault";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
sha256 = "sha256-E7lEKsbl2L6KhLgAZbemCaTIjbsvl3wg3oCURn/Judc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-8ytAT7qVXAIfoeMyTBMJ6DiWn74sRM1WrrOYaKTlKMo=";
|
|
|
|
|
|
|
|
proxyVendor = true;
|
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
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) vault vault-postgresql vault-dev vault-agent; };
|
2020-11-03 02:18:15 +00:00
|
|
|
|
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
|
|
|
license = licenses.mpl20;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "vault";
|
2022-03-30 09:31:56 +00:00
|
|
|
maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri Chili-Man techknowlogick ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|