2021-08-18 13:19:15 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, expect
|
|
|
|
, which
|
|
|
|
, gnupg
|
|
|
|
, coreutils
|
|
|
|
, git
|
|
|
|
, pinentry
|
|
|
|
, gnutar
|
|
|
|
, procps
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-18 13:19:15 +00:00
|
|
|
pname = "blackbox";
|
|
|
|
version = "2.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-08-18 13:19:15 +00:00
|
|
|
owner = "stackexchange";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1plwdmzds6dq2rlp84dgiashrfg0kg4yijhnxaapz2q4d1vvx8lq";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
buildInputs = [ gnupg ];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
# https://github.com/NixOS/nixpkgs/issues/134445
|
|
|
|
doCheck = !stdenv.isDarwin && stdenv.isx86_64;
|
2021-08-18 13:19:15 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-08-18 13:19:15 +00:00
|
|
|
expect
|
|
|
|
which
|
|
|
|
coreutils
|
|
|
|
pinentry.tty
|
|
|
|
git
|
|
|
|
gnutar
|
|
|
|
procps
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs bin tools
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "PREFIX?=/usr/local" "PREFIX=$out"
|
|
|
|
|
|
|
|
substituteInPlace tools/confidence_test.sh \
|
|
|
|
--replace 'PATH="''${blackbox_home}:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:/usr/pkg/bin:/usr/pkg/gnu/bin:''${blackbox_home}"' \
|
|
|
|
"PATH=/build/source/bin/:$PATH"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2021-08-18 13:19:15 +00:00
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
|
|
make copy-install
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Safely store secrets in a VCS repo";
|
|
|
|
maintainers = with maintainers; [ ericsagnes ];
|
2021-08-18 13:19:15 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|