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