nix-dram icon indicating copy to clipboard operation
nix-dram copied to clipboard

use a list of flakes to build flat package namespace

Open nrdxp opened this issue 3 years ago • 2 comments

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.

nrdxp avatar Jul 29 '21 17:07 nrdxp

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 avatar Jul 30 '21 09:07 dramforever

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()

dramforever avatar Jul 30 '21 09:07 dramforever