nixpkgs/pkgs/tools/networking/ipgrep/default.nix

39 lines
944 B
Nix
Raw Normal View History

{ lib, fetchFromGitHub, python3Packages }:
2018-08-01 13:40:57 +00:00
2020-09-13 22:45:13 +00:00
python3Packages.buildPythonApplication rec {
version = "1.0.1";
2018-08-01 13:40:57 +00:00
pname = "ipgrep";
2020-09-13 22:45:13 +00:00
disabled = python3Packages.isPy27;
2018-08-01 13:40:57 +00:00
src = fetchFromGitHub {
owner = "jedisct1";
repo = pname;
rev = version;
2020-09-13 22:45:13 +00:00
hash = "sha256-NrhcUFQM+L66KaDRRpAoC+z5s54a+1fqEepTRXVZ5Qs=";
2018-08-01 13:40:57 +00:00
};
patchPhase = ''
2020-09-13 22:45:13 +00:00
mkdir -p ${pname}
2018-08-01 13:40:57 +00:00
substituteInPlace setup.py \
--replace "'scripts': []" "'scripts': { '${pname}.py' }"
'';
2020-09-13 22:45:13 +00:00
propagatedBuildInputs = with python3Packages; [
2018-08-01 13:40:57 +00:00
pycares
urllib3
requests
];
meta = with lib; {
2018-08-01 13:40:57 +00:00
description = "Extract, defang, resolve names and IPs from text";
longDescription = ''
ipgrep extracts possibly obfuscated host names and IP addresses
from text, resolves host names, and prints them, sorted by ASN.
'';
license = licenses.mit;
maintainers = with maintainers; [ leenaars ];
platforms = platforms.all;
};
}