Conversation
... avoid broken attributes in cases where we can predict that we don't have any. This is far from ideal, but it's the best we can do. If it becomes a shit show, flake authors can opt out.
|
Fortunately this solves the last occurrence of The last remaining |
0b1016f to
ac5c43f
Compare
|
While doesn't seem identical, this reminds me of #114
|
|
@srid I see. Auto-wiring controls can have a similar effect, but their effect is on the internal option values, whereas this is specifically for flake outputs. Auto-wiring:
Touchup:
Auto-wiring controls are a preferable solution, but touchups can solve some long-tail issues without having to model each and every quirk with more flags. |

This PR is a two-parter by necessity, as the goal is to address
formatteroutput is unnecessarily evaluated for all systems #288Unfortunately Nix puts us between a rock and a hard place, and we need more flexibility to deal with possible fallout, hence the new
touchupfeature.1. Strictness problem
To put it briefly,
filterAttrsinduces strictness, but we need it to removenulls whichnix flake checkdoes not allow.Analyzing
perSystemis tricky, but doesn't seem to be much of a problem in this particular case, at least in my testing.formatteroutput is unnecessarily evaluated for all systems #288nullinnix flake check2.
touchupmoduleThis might be kind of exciting actually.
It adds a little attribute-based DSL that makes it easy to make alterations to the flake outputs.
A presentation layer of sorts, bridging the normally small gap between Nix-as-programming and Nix-as-data.
Actually it's not attribute-based but (deferred) module based, as illustrated by the last example in
extras/touchup.nix, which is the file that serves as the introduction (will be published on flake.parts of course).