Customizing packages in Nix

I was trying to explain how to customize packages in Nix. Found the manual section on this topic, but I felt it didn’t really gave a good overview and seemed incorrect in some places.

So I thought I’d write a post about it:

https://bobvanderlinden.me/customizing-packages-in-nix/

Maybe I can incorporate some of the post into the manual again.

10 Likes

Very well written, the differentiation between a modified package and how to use it is what I would have needed at the beginning! Many examples directly throw overlays into the mix which makes it confusing IMO.

3 Likes

Thanks! Indeed, I had the idea the overlays (in combination with ~/.config/nixpkgs/config.nix) can be very confusing when overly used.

It requires explaining final and prev, which is hard on its own. In the manual they are called self and super, which is extra confusing. In general the alternatives should be preferred where possible.

This also does seem to be a bit of a trend. Longtime Nix users avoiding certain Nix features, while they are recommended by the manual. Overlays, nix-env, nix-channels, amongst others.

1 Like

I’ve been trying to gain some confidence in updating/altering packages lately, so this is a super helpful post, thanks!

2 Likes

@bobvanderlinden , this is excellent writing. If you can, please incorporate it in official docs. Thank you very much.

I’m trying :sweat_smile: any help/review is appreciated! nixos/doc: rewrite customizing-packages section by bobvanderlinden · Pull Request #196955 · NixOS/nixpkgs · GitHub

1 Like
Hosted by Flying Circus.