You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current data model, a value changes from thunk to attrset, and any value that's identified as an attrset has a known set of names. This means there's no step in-between where an attrset is usable without knowing all the names.
As for values, those can all remain unknown, in their thunk state.
This really constrains what any filterAttrs implementation can do, even here.
Changing the data model would be a significant change (which has been attempted in #4154, but now highly out of date, and evaluator optimizations since then may have changed the balance)
Alternatively something along the lines of #8187 could make the concept of an attrset abstract and user-implementable. Given the right proxy interface, a lazier filterAttrs is implementable.
What I had in mind for this issue is just a faster lib.filterAttrs though. Same for #15100
Activity
Pandapip1 commentedon May 13, 2026
Bump! Having a lazy
filterAttrswould be exceptionally helpful for https://codeberg.org/Pandapip1/nixos-linux-rt (see #15847)roberth commentedon May 20, 2026
This wouldn't be any different from
lib.filterAttrssemantically, except slightly faster to execute.Pandapip1 commentedon May 20, 2026
Wouldn't it be able to avoid instantiating everything in the original attrset (which
lib.filerAttrscurrently has to do)?roberth commentedon May 20, 2026
In the current data model, a value changes from thunk to attrset, and any value that's identified as an attrset has a known set of names. This means there's no step in-between where an attrset is usable without knowing all the names.
As for values, those can all remain unknown, in their thunk state.
This really constrains what any
filterAttrsimplementation can do, even here.Changing the data model would be a significant change (which has been attempted in #4154, but now highly out of date, and evaluator optimizations since then may have changed the balance)
Alternatively something along the lines of #8187 could make the concept of an attrset abstract and user-implementable. Given the right proxy interface, a lazier filterAttrs is implementable.
What I had in mind for this issue is just a faster
lib.filterAttrsthough. Same for #15100