at 24.05-pre 53 lines 1.5 kB view raw
1{ stdenv, lib, fetchFromGitHub, buildGoModule, installShellFiles, nixosTests 2, makeWrapper 3, gawk 4, glibc 5}: 6 7buildGoModule rec { 8 pname = "vault"; 9 version = "1.14.4"; 10 11 src = fetchFromGitHub { 12 owner = "hashicorp"; 13 repo = "vault"; 14 rev = "v${version}"; 15 sha256 = "sha256-E7lEKsbl2L6KhLgAZbemCaTIjbsvl3wg3oCURn/Judc="; 16 }; 17 18 vendorHash = "sha256-8ytAT7qVXAIfoeMyTBMJ6DiWn74sRM1WrrOYaKTlKMo="; 19 20 proxyVendor = true; 21 22 subPackages = [ "." ]; 23 24 nativeBuildInputs = [ installShellFiles makeWrapper ]; 25 26 tags = [ "vault" ]; 27 28 ldflags = [ 29 "-s" "-w" 30 "-X github.com/hashicorp/vault/sdk/version.GitCommit=${src.rev}" 31 "-X github.com/hashicorp/vault/sdk/version.Version=${version}" 32 "-X github.com/hashicorp/vault/sdk/version.VersionPrerelease=" 33 ]; 34 35 postInstall = '' 36 echo "complete -C $out/bin/vault vault" > vault.bash 37 installShellCompletion vault.bash 38 '' + lib.optionalString stdenv.isLinux '' 39 wrapProgram $out/bin/vault \ 40 --prefix PATH ${lib.makeBinPath [ gawk glibc ]} 41 ''; 42 43 passthru.tests = { inherit (nixosTests) vault vault-postgresql vault-dev vault-agent; }; 44 45 meta = with lib; { 46 homepage = "https://www.vaultproject.io/"; 47 description = "A tool for managing secrets"; 48 changelog = "https://github.com/hashicorp/vault/blob/v${version}/CHANGELOG.md"; 49 license = licenses.mpl20; 50 mainProgram = "vault"; 51 maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri Chili-Man techknowlogick ]; 52 }; 53}