gytis-ivaskevicius / flake-utils-plus

Use Nix flakes without any fluff.
MIT License
485 stars 57 forks source link

Add 'channels' argument to sharedOverlays #130

Closed jorsn closed 3 months ago

jorsn commented 1 year ago

Hi, thanks for this project!

I wanted to resort to a default package from the default channel, if some predicate on the channel is satisfied. Using the channels argument to mkFlake, it is only possible to select the channels by name, while the function sharedOverlays doesn't have the channels argument of overlaysBuilder, so I didn't know how to access the default channel.

Wouldn't it be more consistent and more flexible to add the channels argument to sharedOverlays, and letting it appear as just another overlaysBuilder to the user?


The solution I used is to specify channels by name (https://github.com/jorsn/ancienTeX.nix/blob/707118d0f2202b016dcdcd5cff4e74877db0986b/flake.nix#L82), but I'd like to have it based on a predicate.

gytis-ivaskevicius commented 1 year ago

channels argument is omitted since it is super easy to get infinite recursion happening that way. Unless you have some solid implementation idea I suggest configuring overlays per channel in this case

PS: don't forget that you can use let block to avoid code duplication