From 2dea3d8e2820aa8502de18f865c39be08f970672 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 18 Apr 2026 23:14:28 +0900 Subject: [PATCH] Fix package fetching for nixos-25.11 and nixos-unstable 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). --- src/Nix.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Nix.hs b/src/Nix.hs index f90eccdf46..a452b1085f 100644 --- a/src/Nix.hs +++ b/src/Nix.hs @@ -230,9 +230,17 @@ downloadTo filePath commit = -- Enable recursion into attribute sets that nix-env normally -- doesn't look into so that we can get a more complete picture -- of the available packages for the purposes of the index. + -- Inline `recurseIntoAttrs` instead of relying on it being on + -- `super`/`super.lib`. Old revisions (nixos-20.03 and earlier) + -- only expose it as `super.recurseIntoAttrs` because + -- `lib.recurseIntoAttrs` was added later (lands in 20.09). + -- Newer revisions (nixos-25.11+) no longer expose it on + -- `super` at all. Setting `recurseForDerivations = true` is + -- the underlying mechanism and has been stable across every + -- revision we index. , " packageOverrides = super: {" - , " haskellPackages = super.recurseIntoAttrs super.haskellPackages;" - , " rPackages = super.recurseIntoAttrs super.rPackages;" + , " haskellPackages = super.haskellPackages // { recurseForDerivations = true; };" + , " rPackages = super.rPackages // { recurseForDerivations = true; };" , " };" , "}" ]