Skip to content

Make the legacyPackages schema lazier - #39

Merged
edolstra merged 1 commit into
mainfrom
lazy-legacy-packages
Mar 1, 2025
Merged

edolstra merged 1 commit into
mainfrom
lazy-legacy-packages

Conversation

@edolstra

@edolstra edolstra commented Mar 1, 2025

Copy link
Copy Markdown
Collaborator

Previously we tried to filter out attributes that are neither a derivation or a recurseForDerivations attrset. However, this meant that we had to evaluate every attribute just to get the list of attributes. Thus, since NixOS/nix@5fddc13 (where Nix started using flake schemas for regular evaluations), an operation like nix build nixpkgs#hello would be much slower than needed and print a lot of warnings.

The solution is to not filter out attributes. Instead, we just return a value { what = "unknown"; } for unrecognized attributes.

Previously we tried to filter out attributes that are neither a
derivation or a `recurseForDerivations` attrset. However, this meant
that we had to evaluate every attribute just to get the list of
attributes. Thus, since
NixOS/nix@5fddc13
(where Nix started using flake schemas for regular evaluations), an
operation like `nix build nixpkgs#hello` would be much slower than
needed and print a lot of warnings.

The solution is to not filter out attributes. Instead, we just return
a value `{ what = "unknown"; }` for unrecognized attributes.
@edolstra
edolstra force-pushed the lazy-legacy-packages branch from adc4bb0 to 4af992e Compare March 1, 2025 17:25
@edolstra
edolstra merged commit e13fd56 into main Mar 1, 2025
@edolstra
edolstra deleted the lazy-legacy-packages branch March 1, 2025 20:06
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