Skip to content

Conversation

@sandydoo
Copy link
Member

Our tools construction returns null for packages that are missing (for whatever reason). While this works okay for our internal module system, external consumers of the packages output sometimes make the assumption that these are all valid derivations.

At some point we added a filter that would remove the nulls, however this introduced even worse issues. To filter out the nulls, we need to evaluate each tool. But not all tools can be evaluated: some are stubs that throws (useful) errors. So now we're forced to supress removal notices and other messages to be able to evaluate the tool list.

This commit refactors tools to return placeholder derivations. These can be safely filtered out if needed.

@sandydoo sandydoo force-pushed the fix-eval branch 4 times, most recently from a848672 to 4a18ea2 Compare November 21, 2025 23:37
Our `tools` construction returns `null` for packages that are missing (for whatever reason).
While this works okay for our internal module system, external consumers of the packages output sometimes make the assumption that these are all valid derivations.

At some point we added a filter that would remove the nulls, however this introduced even worse issues.
To filter out the nulls, we need to evaluate each tool.
But not all tools can be evaluated: some are stubs that throws (useful) errors.
So now we're forced to supress removal notices and other messages to be able to evaluate the tool list.

This commit refactors tools to return placeholder derivations.
These can be safely filtered out if needed.
Ran into something similar to NixOS/flake-compat#74

`nix-instantiate` seems to skip copying the source to the store, which
then causes the flake import to throw.
@sandydoo sandydoo merged commit 50b9238 into master Nov 24, 2025
12 checks passed
@sandydoo sandydoo deleted the fix-eval branch November 24, 2025 12:45
@sandydoo sandydoo mentioned this pull request Nov 24, 2025
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