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

44 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, go, gox, removeReferencesTo }:
2016-06-05 00:13:30 +03:00
stdenv.mkDerivation rec {
2016-06-05 00:13:30 +03:00
name = "vault-${version}";
2018-12-04 23:55:53 +03:00
version = "1.0.0";
2016-06-05 00:13:30 +03:00
src = fetchFromGitHub {
owner = "hashicorp";
repo = "vault";
2016-09-23 20:34:51 +03:00
rev = "v${version}";
2018-12-04 23:55:53 +03:00
sha256 = "0wqqf9mif6icfl888w2izvml7vqs4hkd5hrq4dhzcyig5w1bp0if";
2016-09-23 20:34:51 +03:00
};
nativeBuildInputs = [ go gox removeReferencesTo ];
2018-08-11 15:47:54 +03:00
preBuild = ''
2017-08-29 19:30:35 +03:00
patchShebangs ./
substituteInPlace scripts/build.sh --replace 'git rev-parse HEAD' 'echo ${src.rev}'
2017-12-04 11:13:07 +03:00
sed -i s/'^GIT_DIRTY=.*'/'GIT_DIRTY="+NixOS"'/ scripts/build.sh
2018-08-11 15:47:54 +03:00
mkdir -p .git/hooks src/github.com/hashicorp
ln -s $(pwd) src/github.com/hashicorp/vault
2018-08-11 15:47:54 +03:00
export GOPATH=$(pwd)
2016-09-23 20:34:51 +03: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} '{}' +
echo "complete -C $out/bin/vault vault" > $out/share/bash-completion/completions/vault
2016-12-11 16:59:14 +03:00
'';
2016-09-23 20:34:51 +03:00
meta = with stdenv.lib; {
homepage = https://www.vaultproject.io;
description = "A tool for managing secrets";
2017-02-16 22:47:30 +03:00
platforms = platforms.linux ++ platforms.darwin;
2016-09-23 20:34:51 +03:00
license = licenses.mpl20;
2018-08-11 15:47:54 +03:00
maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri ];
2016-06-05 00:13:30 +03:00
};
}