2017-07-02 01:39:55 +01:00
|
|
|
{ stdenv, fetchFromGitHub, go, gox, removeReferencesTo }:
|
2016-06-04 22:13:30 +01:00
|
|
|
|
2018-12-02 23:37:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2016-06-04 22:13:30 +01:00
|
|
|
name = "vault-${version}";
|
2019-02-15 08:55:29 +00:00
|
|
|
version = "1.0.3";
|
2016-06-04 22:13:30 +01:00
|
|
|
|
2016-06-06 11:56:28 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hashicorp";
|
|
|
|
repo = "vault";
|
2016-09-23 18:34:51 +01:00
|
|
|
rev = "v${version}";
|
2019-02-15 08:55:29 +00:00
|
|
|
sha256 = "1c5v1m8b6nm28mjwpsgc73n8q475pkzpdvyx46rf3xyrh01rfrnz";
|
2016-09-23 18:34:51 +01:00
|
|
|
};
|
|
|
|
|
2017-07-02 01:39:55 +01:00
|
|
|
nativeBuildInputs = [ go gox removeReferencesTo ];
|
2017-06-29 03:02:13 +01:00
|
|
|
|
2018-08-11 13:47:54 +01:00
|
|
|
preBuild = ''
|
2017-08-29 17:30:35 +01:00
|
|
|
patchShebangs ./
|
2017-06-29 03:02:13 +01:00
|
|
|
substituteInPlace scripts/build.sh --replace 'git rev-parse HEAD' 'echo ${src.rev}'
|
2017-12-04 08:13:07 +00:00
|
|
|
sed -i s/'^GIT_DIRTY=.*'/'GIT_DIRTY="+NixOS"'/ scripts/build.sh
|
2017-06-29 03:02:13 +01:00
|
|
|
|
2018-08-11 13:47:54 +01:00
|
|
|
mkdir -p .git/hooks src/github.com/hashicorp
|
2017-06-29 03:02:13 +01:00
|
|
|
ln -s $(pwd) src/github.com/hashicorp/vault
|
|
|
|
|
2018-08-11 13:47:54 +01:00
|
|
|
export GOPATH=$(pwd)
|
2019-03-10 21:05:44 +00:00
|
|
|
export GOCACHE="$TMPDIR/go-cache"
|
2016-09-23 18:34:51 +01:00
|
|
|
'';
|
|
|
|
|
2017-06-29 03:02:13 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/bash-completion/completions
|
2017-07-02 01:39:55 +01:00
|
|
|
|
2017-06-29 03:02:13 +01:00
|
|
|
cp pkg/*/* $out/bin/
|
2017-07-02 01:39:55 +01:00
|
|
|
find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
|
|
|
|
|
2018-12-02 23:37:56 +00:00
|
|
|
echo "complete -C $out/bin/vault vault" > $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;
|
2018-08-11 13:47:54 +01:00
|
|
|
maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri ];
|
2016-06-04 22:13:30 +01:00
|
|
|
};
|
|
|
|
}
|