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";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.20220610";
|
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}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-g0oNV7Nj7ZMmsVQFVTDwbKtF4a/Fb3WDB+NRx9IGSWA=";
|
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 \
|
2023-10-09 19:29:22 +00:00
|
|
|
--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:/usr/local/MacGPG2/bin:/opt/homebrew/bin:''${blackbox_home}"' \
|
2021-08-18 13:19:15 +00:00
|
|
|
"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
|
|
|
};
|
|
|
|
}
|