-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat: Pass through individual channel configuration #128
base: main
Are you sure you want to change the base?
Conversation
Channel-specific configuration is now also passed through to flake-utils-plus.mkFlake, allowing channels to have distinct settings and allowing for channel selection for individual hosts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! One quick question, otherwise this looks good to go pending some testing :)
extra-overlays = full-flake-options.overlays or []; | ||
}; | ||
}) | ||
({nixpkgs = {};} // channels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the default nixpkgs
here if we are allowing fully dynamic channel configuration? I think it is possible that the user has channels other than one named nixpkgs
. The previous version of Snowfall Lib made the assumption that inputs.nixpkgs
would always exist, but maybe we don't need to anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say it's still desirable as a fallback. As is, removing it means no inputs are processed at all if the user doesn't go out of their way to configure specific channels, which breaks some valid configurations.
I tried to automatically discover nixpkgs inputs to apply the overlays to all of them out of the box and found some existing solutions but since they tended to feel quite hacky, I went with this because it's backwards compatible with the original behavior while still allowing for user customization. I figured nixpkgs + a handful of oddball channels would fit the vast majority of use cases, so it didn't sound worth the trouble.
Hi @lpchaim I was wondering if you ever managed to make this work? I think the current implementation mostly works with one minor annoyance - it seems that the lib/snowfall-lib/module/default.nix Line 66 in 4054bdc
It seems that the "correct" version of nixpkgs is available in the I am actually not 100% sure, why that line is even needed. I tried commenting it out and the default |
While looking for a way to achieve per host nixpkgs configurations within snowfall a while ago (see #106), I found out it (very understandably) wasn't a supported use case. I've since familiarized myself some more with both nix and snowfall, so I figured I'd try and give solving that issue cleanly a shot. Hopefully the solution I came up with makes sense!
Essentially, channel-specific configuration is now passed through to flake-utils-plus.mkFlake, allowing channels to have distinct settings and making so individual hosts can have their channel changed. Additionally, the same overlays that were once applied only to the default nixpkgs channel are now also applied to any other user-specified channels automatically.
As a demonstration, the following is a minimal working snippet from my personal flake showcasing how I manage to enable cuda support for my one host with a NVIDIA GPU without affecting the other hosts.