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";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.17.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hashicorp";
|
|
|
|
repo = "vault";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-OMA4c+Ot5xioRdI4z7zY4Eux8KxxIZ4opnT/xSc5oUk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
vendorHash = "sha256-MJPKICuaxyUA8DQsdeToJK7HQk1VINNjv7JGjb1mrCs=";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
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/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool for managing secrets";
|
2020-11-24 20:58:05 +00:00
|
|
|
changelog = "https://github.com/hashicorp/vault/blob/v${version}/CHANGELOG.md";
|
2024-01-13 08:15:51 +00:00
|
|
|
license = licenses.bsl11;
|
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
|
|
|
};
|
|
|
|
}
|