[plugins] flakes should be in own dir #1626
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
What this fixes:
When plugins create flake in a directory shared with other files,
nix search
can break. (We usenix search
to determine output path). For example in the mysql plugin the flake would live side-by-side with therun
directory which has a sock file.nix search
would recurse in that directory and try to search for nix expressions and break because the file had an unexpected format.How it was surfaced:
This issue was previously hidden because we don't call
nix search
if a package has already been installed. The bug fixed in #1625 was causing us to needlessly callnix search
on stuff that was alreadySolution:
The partial solution in this PR is to always create the flake in its own dir. This is a bit fragile, e.g. someone can forget if writing their own plugin. Longer term, we need a better way to extract the output path from a custom flake. (I think
nix flake show
could do it without causing the issues surfaced by search)How was it tested?
CICD tests all plugins with exampels.