Four months ago, the first milestone towards RFC 140 was achieved by introducing the pkgs/by-name directory for Nixpkgs, allowing new packages to be declared in that directory instead of the category-based file hierarchy, removing the need for all-packages.nixin most cases. Thanks to the efforts of all the contributors and reviewers, we’ve seen the number of packages in pkgs/by-name skyrocket to over 800!
Now’s time for the next step: Enforcing pkgs/by-name for all new packages (where applicable)! This is implemented in the following PR:
Unless significant problems are brought up, the PR is scheduled to have its final review and merge party on Monday, 2024-01-15T16:00:00Z in this Jitsi, anybody is free to join!
Edit: Now over! While we couldn’t merge during the meeting due to a test failure in CI, I was able to fix it fairly easily.
Only packages using pkgs.callPackage need to use pkgs/by-name, so this doesn’t apply for e.g. python3Packages.callPackage, callPackages (note the s!) or package aliases.
Whether pkgs/by-name should be used is automatically checked by CI, so there’s no need for reviewers to think about this: If CI is green, there’s no problems with pkgs/by-name and merging won’t break it.
This also applies to older PRs that still introduce new packages outside pkgs/by-name: They can still be merged as long as CI is green. CI will start failing if you push new code though, in which case it would have to be moved to pkgs/by-name.
It seems as if these two could easily be fixed manually, but the documentation says we should wait for the automated migration, which is still a draft.
Stupid question: what if a package is built with pkgs.libsForQt5.callPackage or qt5.callPackage… (which is, I expect, the case of all Qt packages?) Is there a way to turn it into a pkgs.callPackage entry, or should we just use the “legacy” way?
I love the pkgs/by-name change. I had special rules in my editor not to highlight all-packages.nix because of its size. It might be written somewhere (the RFC I guess) or enforced in the CI check but I prefer ask here anyay.
Should library functions and wrappers go into pkgs/by-name ? A few examples I have in mind: buildEnv and the neovim wrapper.
I have a bunch of changes to the wrapper I plan to upstream and I would have more peace of mind preemptively moving to pkgs/by-name if it makes sense to avoid future PRs conflicts.