How does the "magic" of lazy evaluation (Pill 13.3) actually produce a result?

Here: NixOS - Nix Pills

allPkgs is defined in terms of pkgs which is defined in terms of callPackage which is defined in terms of allPkgs.

Is the idea that pkgs.hello, pkgs.graphviz, and pkgs.graphvizCore do not depend upon one another so infinite recursion is avoided? (Let me know if this is true.)

The whole thing is evaluated as a fixed point, which means it will keep calling itself recursively until there are no more references to resolve, at least as far as I understand it.

There are also a lot of nice comments in the stage.nix file which allPkgs imports.

1 Like