Hacker News new | past | comments | ask | show | jobs | submit login

I’ve never looked at the process of making a nixpkg, but wouldn’t the review process only catch something malicious if it was added to the packaging process? Anything malicious added to the build process wouldn’t show up correct? At least not unless the package maintainer was familiar and looked themself?



I am not sure I understand the distinction between the packaging and build process, at least in the context of nixpkgs. Packages in nixpkgs are essentially build instructions, which you can either build/compile locally (like Gentoo) but normally you download them from the cache.

Official packages for the nixpkgs cache are built/compiled on Nix's own infrastructure, not by the maintainers, so you can't just sneak malicious code in that way without cracking into the server.

What package maintainers do is contribute these build instructions, called derivations. Here's an example for a moderately complex one:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applicatio...

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applicatio...

As you can see, you can include a patch to the source files, add custom bash commands to be executed and you can point the source code download link to anywhere you want. You could do something malicious in any of these steps, but I expect the reviewer to at least look at it and build it locally for testing before committing, in addition to any other interested party.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: