summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ru/rustscan/package.nix
blob: 361b6fa5d5c75b90a1af2a009912ada895962b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  lib,
  fetchFromGitHub,
  nmap,
  perl,
  python3,
  rustPlatform,
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "rustscan";
  version = "2.4.1";

  src = fetchFromGitHub {
    owner = "bee-san";
    repo = "RustScan";
    tag = finalAttrs.version;
    hash = "sha256-+qPSeDpOeCq+KwZb5ANXx6z+pYbgdT1hVgcrSzxyGp0=";
  };

  cargoHash = "sha256-cUuInYCT2jzen9gswfFGtKum6w2X/SiKA2ccdmxk38A=";

  postPatch = ''
    substituteInPlace src/scripts/mod.rs \
      --replace-fail 'call_format = "nmap' 'call_format = "${nmap}/bin/nmap'
    patchShebangs fixtures/.rustscan_scripts/*
  '';

  nativeCheckInputs = [
    perl
    python3
  ];

  checkFlags = [
    # These tests require network access
    "--skip=parse_correct_host_addresses"
    "--skip=parse_hosts_file_and_incorrect_hosts"
    "--skip=resolver_args_google_dns"
    "--skip=resolver_default_cloudflare"
  ];

  meta = {
    description = "Faster Nmap Scanning with Rust";
    homepage = "https://github.com/bee-san/RustScan";
    changelog = "https://github.com/bee-san/RustScan/releases/tag/${finalAttrs.version}";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ bodier123 ];
    mainProgram = "rustscan";
  };
})