Skip to content

Fix package fetching for nixos-25.11 and nixos-unstable - #59

Open
natsukium wants to merge 1 commit into
lazamar:mainfrom
natsukium:fix-recurse-into-attrs-25.11
Open

Fix package fetching for nixos-25.11 and nixos-unstable#59
natsukium wants to merge 1 commit into
lazamar:mainfrom
natsukium:fix-recurse-into-attrs-25.11

Conversation

@natsukium

@natsukium natsukium commented Apr 19, 2026

Copy link
Copy Markdown

Summary

nixpkgs 25.11+ removed pkgs.recurseIntoAttrs, so nix-env -qaP --json fails for nixos-25.11, nixpkgs-25.11-darwin, nixos-unstable, and nixpkgs-unstable — no packages are indexed for those channels.
Inline recurseForDerivations = true in src/Nix.hs to restore fetching across every indexed channel.

Cause

Nixpkgs commit 03bb7d81954d "all-packages: do not export lib functions from pkgs" (2025-10-30) moved recurseIntoAttrs out of the pkgs/top-level/all-packages.nix result attrset, so super.recurseIntoAttrs in packageOverrides now raises attribute 'recurseIntoAttrs' missing.

Why not switch to super.lib.recurseIntoAttrs?

lib.recurseIntoAttrs was added in 8935bfb4ac36 (2019-09-11), so it is missing from every release before 20.09.
This project indexes from nixos-17.03 upward, so neither super.recurseIntoAttrs (gone in 25.11+) nor super.lib.recurseIntoAttrs (missing pre-20.09) alone covers the full range.

recurseForDerivations = true is the underlying mechanism of recurseIntoAttrs itself (see lib/attrsets.nix) and has been stable across every indexed revision.

Verification

Reproduced against nixos-25.11 HEAD (c7f47036d3df2add644c46d712d14262b7d86c0c) using the same nix-env -qaP --json invocation src/Nix.hs runs per commit.

Before (current config with super.recurseIntoAttrs):

$ nix-env -qaP --json \
    -f https://github.com/NixOS/nixpkgs/archive/c7f47036d3df2add644c46d712d14262b7d86c0c.tar.gz \
    --arg config '{ allowAliases = false; packageOverrides = super: {
      haskellPackages = super.recurseIntoAttrs super.haskellPackages;
      rPackages       = super.recurseIntoAttrs super.rPackages;
    }; }' > /dev/null
error: attribute 'recurseIntoAttrs' missing
# exit 1

After (patched config with inlined recurseForDerivations = true):

$ nix-env -qaP --json \
    -f https://github.com/NixOS/nixpkgs/archive/c7f47036d3df2add644c46d712d14262b7d86c0c.tar.gz \
    --arg config '{ allowAliases = false; packageOverrides = super: {
      haskellPackages = super.haskellPackages // { recurseForDerivations = true; };
      rPackages       = super.rPackages       // { recurseForDerivations = true; };
    }; }' | jq length
127054
# exit 0

Cross-check on the oldest indexed release nixos-17.03 (2c1838ab99b086dccad930e8dcc504b867149a0c) — where super.lib.recurseIntoAttrs would not exist — with the same patched config:

$ nix-env -qaP --json \
    -f https://github.com/NixOS/nixpkgs/archive/2c1838ab99b086dccad930e8dcc504b867149a0c.tar.gz \
    --arg config '{ allowAliases = false; packageOverrides = super: {
      haskellPackages = super.haskellPackages // { recurseForDerivations = true; };
      rPackages       = super.rPackages       // { recurseForDerivations = true; };
    }; }' | jq length
36363
# exit 0

related to #58

Newer nixpkgs revisions (nixos-25.11+) no longer expose
`recurseIntoAttrs` as a top-level attribute on the package set, so
`super.recurseIntoAttrs` in `packageOverrides` raises an evaluation
error and no packages are returned for those channels.

Switching to `super.lib.recurseIntoAttrs` would fix new revisions but
break old ones (e.g. nixos-17.03 has no `lib.recurseIntoAttrs`), so
inline the underlying mechanism (`recurseForDerivations = true`)
instead. That attribute has been the implementation of
`recurseIntoAttrs` for the entire history we index, so the call site
no longer depends on a helper whose location has shifted over time.

Verified end-to-end via `nix-env -qaP --json` against nixos-17.03
(36363 packages), nixos-25.11 (127054), and nixos-unstable (130718).
@unoukujou

Copy link
Copy Markdown

Thanks @natsukium I came here to see why the site no longer gets updated so nice to see this PR

@lazamar any chance to fix? The site was very useful, and still is for older stuff but a shame there is many packages missing now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants