nix-community / nix-init

Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more [maintainer=@figsoda]
https://discourse.nixos.org/t/25035
Mozilla Public License 2.0
883 stars 19 forks source link

Support for kali-linux's gitlab #424

Open pinpox opened 6 months ago

pinpox commented 6 months ago

As part of the effort tracked at https://t4ccer.com/arewehackersyet/ to package most tools available in kali in nixpkgs to make it a viable choice for pentesting I noticed nix-init doesn't work on any of the gitlab urls.

I havn't been able to find out why, since the url seems correct and is reachable, so I must suspect a bug.

Example: Trying with https://gitlab.com/kalilinux/packages/wifi-honey results in this error:

shell ❯ nix-init -u https://gitlab.com/kalilinux/packages/wifi-honey                                                                                                                                                              
Enter tag or revision (defaults to kali/1.0-1kali3)
❯ kali/1.0-1kali3
Enter version
❯ 1.0-1kali3
Enter pname
❯ wifi-honey
Error: command exited with exit status: 1
stdout:

stderr:
$ nix flake prefetch --extra-experimental-features 'nix-command flakes' --json gitlab:kalilinux%2Fpackages/wifi-honey/kali/1.0-1kali3
error:
       … while fetching the input 'gitlab:kalilinux/packages/wifi-honey/kali/1.0-1kali3'

       error: unable to download 'https://gitlab.com/api/v4/projects/kalilinux%2Fpackages/repository/commits?ref_name=wifi-honey/kali/1.0-1kali3': HTTP error 404

       response body:

       {"message":"404 Project Not Found"}
Error: command exited with exit status: 1

I've tried a few other packages and got the same error, let me know if there is a workaround or this can be fixed.