-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
183 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ pkgs }: { | ||
vault = pkgs.callPackage ./vault { }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ stdenv | ||
, lib | ||
, fetchFromGitHub | ||
, buildGoModule | ||
, installShellFiles | ||
, nixosTests | ||
, makeWrapper | ||
, gawk | ||
, glibc | ||
}: | ||
buildGoModule rec { | ||
pname = "vault"; | ||
version = "1.14.8"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "hashicorp"; | ||
repo = "vault"; | ||
rev = "v${version}"; | ||
sha256 = "sha256-sGCODCBgsxyr96zu9ntPmMM/gHVBBO+oo5+XsdbCK4E="; | ||
}; | ||
|
||
vendorHash = "sha256-zpHjZjgCgf4b2FAJQ22eVgq0YGoVvxGYJ3h/3ZRiyrQ="; | ||
|
||
proxyVendor = true; | ||
|
||
subPackages = [ "." ]; | ||
|
||
nativeBuildInputs = [ installShellFiles makeWrapper ]; | ||
|
||
tags = [ "vault" ]; | ||
|
||
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=" | ||
]; | ||
|
||
postInstall = | ||
'' | ||
echo "complete -C $out/bin/vault vault" > vault.bash | ||
installShellCompletion vault.bash | ||
'' | ||
+ lib.optionalString stdenv.isLinux '' | ||
wrapProgram $out/bin/vault \ | ||
--prefix PATH ${lib.makeBinPath [gawk glibc]} | ||
''; | ||
|
||
passthru.tests = { inherit (nixosTests) vault vault-postgresql vault-dev vault-agent; }; | ||
|
||
meta = with lib; { | ||
homepage = "https://www.vaultproject.io/"; | ||
description = "A tool for managing secrets"; | ||
changelog = "https://github.com/hashicorp/vault/blob/v${version}/CHANGELOG.md"; | ||
license = licenses.mpl20; | ||
mainProgram = "vault"; | ||
maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri Chili-Man techknowlogick ]; | ||
}; | ||
} |