Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partitions: allow overriding the flake-compat src #273

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MattSturgeon
Copy link

This is useful when flake-compat is already available, e.g. as a flake input. By allowing consumers to specify the flake-compat to use, they can avoid fetching multiple redundant copies.

It feels like this could be managed with flake inputs and the follows system, however we only depend on flake-compat when a) the partitions module is used, b) a partition has a path-type flake, and c) that partition is actually evaluated. Using a follow-able input would make flake-compat an unconditional dependency. Therefore, I've introduced an internal option that can be used instead (flakeCompatSrc).

Maybe the option doesn't need to be internal. I've added the appropriate docs in case it is marked as public (or someone reads the source code). However, the use of flake-compat vs builtins.getFlake feels like an internal implementation detail, so I was hesitant to make it a public/visible option.

This is useful when flake-compat is already available, e.g. as a flake
input.

By allowing consumers to specify the flake-compat to use, we can avoid
fetching multiple redundant copies.
@MattSturgeon
Copy link
Author

Maybe this is conceptually flawed too, since most of the time a flake shouldn't have flake-compat in its unconditional root flake inputs.

So the existing behavior of fetching flake-compat only when evaluating a partition is probably best. This new option may encourage consumers to specify a superfluous flake-compat input in their flakes 🤔

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.

1 participant