Request walkthrough for nixpkgs code from importing to getting an attr set

I’ve always thought it would be nice to have a walkthrough of all the nixpkgs code that runs between importing nixpkgs and actually getting the resulting attribute set with all the packages.

When using nixpkgs, you can easily do something like the following:

  nixpkgs = import <nixpkgs> {};

I’d like a walkthrough of all the code (well, the interesting parts) that runs when doing import <nixpkgs> {} and gives you back the actual package set.

I imagine this walkthrough would start off with an explanation of the following files:

and go on to the other files that are being called.

I’ve tried to read through the code on my own, but I tend to get bogged down in the complexity of the cross-compiling-related stuff and bootstrapping stuff.

I think a video would be a good format for this, since it would allow someone to easily comment on each part of the code, without having to list everything out explicitly in written form.

I’ve been trying to help maintain some of the Haskell-related stuff in nixpkgs, but I feel like my limited-knowledge of the cross-compilation-related functionality is really holding me back for understanding some of the code.

I posted another thread with questions about cross compilation: Request explanation of cross-compilation-related package sets (buildPackages, targetPackages, etc), but unfortunately I haven’t gotten any response.


This might be a good topic for @zimbatm’s Nix Friday - streaming about Nix every Friday


@ryantm Thanks for the suggestion. I’ll actually be joining @zimbatm next week on Nix Friday to talk about JavaScript packaging, so I’ll have to ask him if he’d be interested in doing something like this as well.