nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 buildGoModule,
6 installShellFiles,
7 nixosTests,
8 makeWrapper,
9 gawk,
10 glibc,
11}:
12
13buildGoModule rec {
14 pname = "vault";
15 version = "1.20.1";
16
17 src = fetchFromGitHub {
18 owner = "hashicorp";
19 repo = "vault";
20 rev = "v${version}";
21 hash = "sha256-tTlfTd96+WiTk5HmtHws/zU3jrFfBnce6Wrtr7XsENY=";
22 };
23
24 vendorHash = "sha256-kdtWmRrzvHXPh/DIYkeGS7oSKB+lKiBdglld13av9FY=";
25
26 proxyVendor = true;
27
28 subPackages = [ "." ];
29
30 nativeBuildInputs = [
31 installShellFiles
32 makeWrapper
33 ];
34
35 tags = [ "vault" ];
36
37 ldflags = [
38 "-s"
39 "-w"
40 "-X github.com/hashicorp/vault/sdk/version.GitCommit=${src.rev}"
41 "-X github.com/hashicorp/vault/sdk/version.Version=${version}"
42 "-X github.com/hashicorp/vault/sdk/version.VersionPrerelease="
43 ];
44
45 postInstall = ''
46 echo "complete -C $out/bin/vault vault" > vault.bash
47 installShellCompletion vault.bash
48 ''
49 + lib.optionalString stdenv.hostPlatform.isLinux ''
50 wrapProgram $out/bin/vault \
51 --prefix PATH ${
52 lib.makeBinPath [
53 gawk
54 glibc
55 ]
56 }
57 '';
58
59 passthru.tests = {
60 inherit (nixosTests)
61 vault
62 vault-postgresql
63 vault-dev
64 vault-agent
65 ;
66 };
67
68 meta = {
69 homepage = "https://www.vaultproject.io/";
70 description = "Tool for managing secrets";
71 changelog = "https://github.com/hashicorp/vault/blob/v${version}/CHANGELOG.md";
72 license = lib.licenses.bsl11;
73 mainProgram = "vault";
74 maintainers = with lib.maintainers; [
75 rushmorem
76 lnl7
77 offline
78 pradeepchhetri
79 Chili-Man
80 techknowlogick
81 ];
82 };
83}