NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.84k stars 13.22k forks source link

REGRESSION: Package request: nmap_graphical #287288

Open kennystrawnmusic opened 5 months ago

kennystrawnmusic commented 5 months ago

Project description

The nmap_graphical package (which installs zenmap, the official graphical frontend to nmap) was previously removed from nixpkgs due to it still depending on Python 2 back in 2020, however, Python 3 support has since been added as of 2024 and I've managed to get it working properly using overrideAttrs with the following changes to my /etc/nixos/configuration.nix file:

...
environment.systemPackages = with pkgs; [
  ...
  (nmap.overrideAttrs(old: rec {
    nativeBuildInputs = old.nativeBuildInputs ++ [
      gobject-introspection
      (python3.withPackages(pypkgs: [
        pypkgs.pygobject3
      ]))
      wrapGAppsHook
    ];

    buildInputs = old.buildInputs ++ [ gtk3 ];

    configureFlags = lib.remove "--without-zenmap" (lib.flatten old.configureFlags);

    installPhase = ''
      cd zenmap
      python setup.py install --prefix=$out
      sed -i "58a sys.path.append(\"$out/lib/python${python3.sourceVersion.major}.${python3.sourceVersion.minor}/site-packages/\")" $out/bin/zenmap
    '';
  }))
  ...
];

Although this hacky solution does work for getting Zenmap to work properly for those who are looking for a workaround to this issue, it would be helpful for other users who may not know what they're doing to either document this on a wiki page or, better yet, reintroduce the package that was removed while incorporating these overrides into the reintroduction.

Metadata


Add a :+1: reaction to issues you find important.

BlueskyFR commented 5 months ago

Hey! I am very interested in that too :)

Any results so far?