Repository navigation
flake: fix legacyPackages evaluation and double-applied overlays - #20
Merged
Merged
Conversation
default.nix only accepted `modules`, so the flake's `inherit system;` failed with "unexpected argument 'system'". Accept and pass through any other arguments to corepkgs, as haskell-pkgs does. The flake also passed pkgs-module.nix in `modules`, which default.nix already appends, so every overlay was applied twice through the flake. Stop passing it.
default.nix already appends pkgs-module.nix to the modules it passes to corepkgs, so passing it again applied every overlay twice.
jonringer
force-pushed
the
jonringer/fix-flake-legacy-packages
branch
from
November 13, 2026 22:16
cec95cf to
b28fe29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
legacyPackagesis broken on master:nix flake check --no-builddoesn't catch it because it never forces anything insidelegacyPackages.Root cause
f3bccf5 ("default.nix: clean up module logic") changed
default.nix's formals from{ overlays ? [ ], config ? { }, ... }to{ modules ? [ ] }and dropped the.... The flake still callsimport ./. { inherit system; ... }, so the call fails.default.nixalready forwards any remaining args to corepkgs throughfilteredAttrs, but the strict formals reject them first.The flake also had a second bug, the same one as ekapkgs#141. It passed
modules = [ pkgsModule ], butdefault.nixalready appends./pkgs-module.nix. The module is an anonymous function with nokey, soevalModulesdoesn't dedupe it, and every overlay was applied twice:config.overlays.pythonandconfig.overlays.pkgseach had 4 entries instead of 2.ci/repos-packages.nixdid the same thing.Fix
flake: fix legacyPackages evaluation: add...todefault.nix's formals sosystem(and any other corepkgs argument) is passed through, as in haskell-pkgs'default.nix. Make the flake callimport ./. { inherit system; }, the way corepkgs' flake does, without addingpkgs-module.nixa second time.ci/repos-packages: stop passing pkgs-module.nix to ./. a second time.Other outputs
The other outputs are only
formatter(corepkgs.formatter, which evaluates fine) andnixConfig. There are nopackages,checksordevShells.nixConfigsits insideoutputs, so Nix ignores it ("unknown flake output"). corepkgs and ekapkgs do the same, so I've left it alone.Verification
nix eval .#legacyPackages.x86_64-linux.python3Packages.requests.drvPath: fails on master, and on this branch returns/nix/store/7p2fff2g…-python3.13-requests-2.34.2.drv, the same asimport ./. {}.import ./. {}for requests, numpy, scipy, pandas, matplotlib, django, qhull, xsimd and curl. It also matches on a 200-attribute stride sample ofpython3Packages: no differences, 199 evaluated, and 1 fails in both. Both entry points now have 2pythonand 2pkgsoverlays.ci/repos-packages.nix: all 83 drvPaths are the same before and after. The overlays turned out to be idempotent, so the duplicate only cost evaluation time there.nix flake check --no-buildpasses.ci/eval.shreports "All 7238 packages evaluate.", the same as master.nixfmtfrom nixfmt-rs 0.4.1 rather thannix fmt.This branch doesn't depend on #19, and it doesn't conflict with it: #19 only touches
pins.nixandfetch-locked.nix.