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

use a list of flakes to build flat package namespace #10

Open
nrdxp opened this issue Jul 29, 2021 · 2 comments
Open

use a list of flakes to build flat package namespace #10

nrdxp opened this issue Jul 29, 2021 · 2 comments

Comments

@nrdxp
Copy link
Contributor

nrdxp commented Jul 29, 2021

One of the biggest objections to this patchset so far has been that some don't want to privilege any given flake over the others. I realized we might resolve this by allowing for more than one flake to combine their package outputs together into a flat package space for nix to search.

We could even set the default to add all the registry flakes together into a flat package space. This could be done by building on your work in #9 and simply extending it to accept multiple flakes.

I'm just not yet sure how much this would increase the complexity of the implementation.

@dramforever
Copy link
Owner

and simply extending it to accept multiple flakes

'Simply'...

To be fair though, from a user's perspective it does seem to be a simple way to use multiple flake with a single installable.

The main thing that will be a problem is that it's going to sometimes download a large number of flakes and evaluate them just to find where one installable is.

Another problem is that attributes will invariably clash. For packages it's less of a problem, but there are things like lib and devShell. If we're going to create different cases for different command that's going to be some work.

I don't think this will work with the entire registry plus user defined entries. If it's just those specified by the user in default-flakes though it might work.

@dramforever
Copy link
Owner

From a source code perspective, I think I'll just create a subclass of Installable based on InstallableFlake, probably call it InstallableFlakeMulti. It will search the attribute in a list of specified flakes in order and find the first match. Some sort of variation on InstallableFlake::toValue()

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

No branches or pull requests

2 participants