nixpkgs/pkgs/tools/security/vault/default.nix

50 lines
1.4 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, go, gox, removeReferencesTo }:
2016-06-04 22:13:30 +01:00
2016-12-11 13:59:14 +00:00
let
vaultBashCompletions = fetchFromGitHub {
owner = "iljaweis";
repo = "vault-bash-completion";
2017-01-28 20:08:50 +00:00
rev = "e2f59b64be1fa5430fa05c91b6274284de4ea77c";
sha256 = "10m75rp3hy71wlmnd88grmpjhqy0pwb9m8wm19l0f463xla54frd";
2016-12-11 13:59:14 +00:00
};
in stdenv.mkDerivation rec {
2016-06-04 22:13:30 +01:00
name = "vault-${version}";
2017-08-29 17:30:35 +01:00
version = "0.8.1";
2016-06-04 22:13:30 +01:00
src = fetchFromGitHub {
owner = "hashicorp";
repo = "vault";
2016-09-23 18:34:51 +01:00
rev = "v${version}";
2017-08-29 17:30:35 +01:00
sha256 = "19y688nvi0vr7cdnaa5sy2m65xicjwi5qgkgzyjvb7r3zb0dnli1";
2016-09-23 18:34:51 +01:00
};
nativeBuildInputs = [ go gox removeReferencesTo ];
buildPhase = ''
2017-08-29 17:30:35 +01:00
patchShebangs ./
substituteInPlace scripts/build.sh --replace 'git rev-parse HEAD' 'echo ${src.rev}'
mkdir -p src/github.com/hashicorp
ln -s $(pwd) src/github.com/hashicorp/vault
GOPATH=$(pwd) make
2016-09-23 18:34:51 +01:00
'';
installPhase = ''
mkdir -p $out/bin $out/share/bash-completion/completions
cp pkg/*/* $out/bin/
find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
cp ${vaultBashCompletions}/vault-bash-completion.sh $out/share/bash-completion/completions/vault
2016-12-11 13:59:14 +00:00
'';
2016-09-23 18:34:51 +01:00
meta = with stdenv.lib; {
homepage = https://www.vaultproject.io;
description = "A tool for managing secrets";
2017-02-16 19:47:30 +00:00
platforms = platforms.linux ++ platforms.darwin;
2016-09-23 18:34:51 +01:00
license = licenses.mpl20;
2017-01-28 20:08:50 +00:00
maintainers = with maintainers; [ rushmorem offline pradeepchhetri ];
2016-06-04 22:13:30 +01:00
};
}