nixpkgs/pkgs/applications/version-management/blackbox/default.nix
Mario Rodas e06d12d715 blackbox: 2.0.0 -> 1.20220610
Upstream dropped the version 2.0.0, and its tag is no longer available.
2023-08-30 04:20:00 +00:00

64 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, expect
, which
, gnupg
, coreutils
, git
, pinentry
, gnutar
, procps
}:
stdenv.mkDerivation rec {
pname = "blackbox";
version = "1.20220610";
src = fetchFromGitHub {
owner = "stackexchange";
repo = pname;
rev = "v${version}";
hash = "sha256-g0oNV7Nj7ZMmsVQFVTDwbKtF4a/Fb3WDB+NRx9IGSWA=";
};
buildInputs = [ gnupg ];
# https://github.com/NixOS/nixpkgs/issues/134445
doCheck = !stdenv.isDarwin && stdenv.isx86_64;
nativeCheckInputs = [
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:/usr/local/MacGPG2/bin:/opt/homebrew/bin:''${blackbox_home}"' \
"PATH=/build/source/bin/:$PATH"
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
make copy-install
runHook postInstall
'';
meta = with lib; {
description = "Safely store secrets in a VCS repo";
maintainers = with maintainers; [ ericsagnes ];
license = licenses.mit;
platforms = platforms.all;
};
}