nixpkgs/pkgs/tools/security/hash-slinger/default.nix

64 lines
1.3 KiB
Nix
Raw Normal View History

2021-10-22 15:23:48 +00:00
{ lib
, stdenv
, fetchFromGitHub
, python3
, unbound
, libreswan
}:
2016-07-20 16:09:44 +00:00
2021-10-22 15:23:48 +00:00
stdenv.mkDerivation rec {
pname = "hash-slinger";
version = "3.1";
2016-07-20 16:09:44 +00:00
src = fetchFromGitHub {
owner = "letoams";
2019-09-08 23:38:31 +00:00
repo = pname;
rev = version;
2021-10-22 15:23:48 +00:00
sha256 = "sha256-mhMUdZt846QjwRIh2m/4EE+93fUcCKc2FFeoFpzKYvk=";
2016-07-20 16:09:44 +00:00
};
2021-10-22 15:23:48 +00:00
pythonPath = with python3.pkgs; [
dnspython
m2crypto
python-gnupg
pyunbound
];
2016-07-20 16:09:44 +00:00
2021-10-22 15:23:48 +00:00
buildInputs = [
python3.pkgs.wrapPython
];
2016-07-20 16:09:44 +00:00
2021-10-22 15:23:48 +00:00
propagatedBuildInputs = [
unbound
libreswan
] ++ pythonPath;
propagatedUserEnvPkgs = [
unbound
libreswan
];
postPatch = ''
2016-07-20 16:09:44 +00:00
substituteInPlace Makefile \
--replace "$(DESTDIR)/usr" "$out"
substituteInPlace ipseckey \
--replace "/usr/sbin/ipsec" "${libreswan}/sbin/ipsec"
substituteInPlace tlsa \
2021-10-22 15:23:48 +00:00
--replace "/var/lib/unbound/root" "${python3.pkgs.pyunbound}/etc/pyunbound/root"
2016-07-20 16:09:44 +00:00
patchShebangs *
2021-10-22 15:23:48 +00:00
'';
2016-07-20 16:09:44 +00:00
installPhase = ''
2021-10-22 15:23:48 +00:00
mkdir -p $out/bin $out/man $out/lib/${python3.libPrefix}/site-packages
2016-07-20 16:09:44 +00:00
make install
wrapPythonPrograms
2021-10-22 15:23:48 +00:00
'';
2016-07-20 16:09:44 +00:00
2021-10-22 15:23:48 +00:00
meta = with lib; {
2016-07-20 16:09:44 +00:00
description = "Various tools to generate special DNS records";
2021-10-22 15:23:48 +00:00
homepage = "https://github.com/letoams/hash-slinger";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ leenaars ];
2016-07-20 16:09:44 +00:00
};
}