1{ lib, rustPlatform, fetchCrate, nmap, stdenv, Security, perl, python3 }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "rustscan";
5 version = "2.1.1";
6
7 src = fetchCrate {
8 inherit pname version;
9 sha256 = "sha256-yGVhbI1LivTIQEgqOK59T1+8SiTJBPIdftiXkwE4lZM=";
10 };
11
12 cargoSha256 = "sha256-UR3ktV80QU0N3f7qmqdhYpc5uwoPq4UvN40zEuMbp+Q=";
13
14 postPatch = ''
15 substituteInPlace src/scripts/mod.rs \
16 --replace 'call_format = "nmap' 'call_format = "${nmap}/bin/nmap'
17 patchShebangs fixtures/.rustscan_scripts/*
18 '';
19
20 buildInputs = lib.optional stdenv.isDarwin Security;
21
22 nativeCheckInputs = [ perl python3 ];
23
24 # these tests require network access
25 checkFlags = [
26 "--skip=parse_correct_host_addresses"
27 "--skip=parse_hosts_file_and_incorrect_hosts"
28 ];
29
30 meta = with lib; {
31 description = "Faster Nmap Scanning with Rust";
32 homepage = "https://github.com/RustScan/RustScan";
33 license = licenses.gpl3Only;
34 maintainers = with maintainers; [ figsoda ];
35 };
36}