-
Notifications
You must be signed in to change notification settings - Fork 42
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
partitionedAttrs from multiple partitions? #258
Comments
Partitions are intended as a performance optimization to avoid loading some modules (from some
Merging multiple partitions into a flake output would give you the worst of both, because you'll have more total evaluation work due to having these partitions, and you still need to evaluate all the listed ones in order to produce To keep it efficient, you will have to list explicitly which partition is responsible for which attribute. The current type, mapping single output attribute names to single partition names enforces that, but it doesn't let you specify anything inside those single output attributes. Those would have to be attribute paths, or even a pattern of sorts, because we have to deal not just with records but also dicts. {
partitionedAttrs.packages."*".foo = "component1";
partitionedAttrs.packages."*".bar = "component2";
partitionedAttrs.devShells = "dev";
} I do wonder whether a more versatile abstraction could be built into the module system proper. This is a general solution to probably an even more general problem. |
Hmm, that is true, thank you for the clarification. I guess generally it could be solved by just splitting things into modules. I just thought that it would be good to let some things be their own flakes as that would allow the different components to control their inputs. I imagine you would want to share inputs (and evaluation) most of the time, but in some cases you would want to override or add extra inputs. I was just thinking whether a mono-repo style with multiple components aggregated at the top-level using partitions was feasible. But perhaps a different approach would have to be used. |
I wonder if it would make sense to support a list for the
partitionedAttrs
. For example if you have multiple partitions providing packages and want to propagate them.Currently you can do:
But what if you had multiple partitions providing packages?
With this feature you could replace other use cases for subflakes as well.
What do you think, would it make sense to support?
The text was updated successfully, but these errors were encountered: