-
-
Notifications
You must be signed in to change notification settings - Fork 6
Refactor unfree aspect to use a module #128
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
Conversation
|
Hey, @Shawn8901 Thanks a lot for this. All den features have tests in templates/examples/, see existing ones under ci/ directory. Could you please make sure we have at least a test that ensures the unfree aspect works as you intend ? |
|
I have altered the unfree case to over the new changes. I hope that is okay, but as the whole logic now changes i thought that is a the best solution. I had thought about adding extra checks to evaluate the unfreePredicate, tho if it would not compose the unfree package list it either should fail on building Should i also add an extra case for having it as |
|
your changes look good, updating the previous test is correct . |
|
Thx for the feedback. |
22b9a66 to
f859600
Compare
I hope the CI issue should be fixed now |
|
awesome work @Shawn8901!, looking good, just added a minor comment. |
c586878 to
245796f
Compare
|
let me inherit den.lib also in the prefix builder edit: done |
This allows the aspect to be included in other aspects and compose all unfree packages that are defined.
|
Thanks @Shawn8901 |
This allows the aspect to be included in other aspects and compose all unfree packages that are defined.
Context:
I want to use
<den/unfree>in multiple aspects and have their defined packages to combined to one largeallowUnfreePredicate.That allows to define the unfree packages in the aspects near their usage and not on the respective class definition (e.G. the host).
Here an example on my tryout repo where i am currently exploring how to build my configs with den.
This defines an unfree predicate for vscode and the respective addons:
https://github.com/Shawn8901/dend_test/blob/main/modules/aspects/cfg/desktop/coding.nix
This defines my printer
https://github.com/Shawn8901/dend_test/blob/main/modules/aspects/cfg/printer.nix#L6
Both are later on then used in the host pointalpha together, whilst the printer aspect is not used on my zenbook.
Possible workarounds
nixpkgs.config.allowUnfree = trueOther resources
Discussion on zulip https://oeiuwq.zulipchat.com/#narrow/channel/548534-den/topic/feat-idea.20composable.20unfree.20batteries/with/564892231
Actual "root issue" why predicates are not combine/composable by default NixOS/nixpkgs#197325
Possible Todos
One issue i found is, that it does not play well with settingas its setting anixpkgs.config.allowUnfreePredicateeven tho its not allowed when usinguseGlobalPkgsin homeManager class.This should just be done ifuseGlobalPkgsis set to false, tho i am not yet fully confident how to set that condition correctly with den.Might have found a reasonable solution for that, see #128 (comment)