Skip to content

Conversation

@Shawn8901
Copy link
Contributor

@Shawn8901 Shawn8901 commented Dec 29, 2025

This allows the aspect to be included in other aspects and compose all unfree packages that are defined.

⚠️ I just have tested the code for nixos and home-manager (as module) definitions.

Context:

I want to use <den/unfree> in multiple aspects and have their defined packages to combined to one large allowUnfreePredicate.

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

  • Gather unfree packages by hand and define them once on a class
  • use nixpkgs.config.allowUnfree = true

Other 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 setting

 nixos.home-manager.useGlobalPkgs = true;

as its setting a nixpkgs.config.allowUnfreePredicate even tho its not allowed when using useGlobalPkgs in homeManager class.
This should just be done if useGlobalPkgs is 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)

@Shawn8901 Shawn8901 marked this pull request as draft December 30, 2025 20:13
@Shawn8901 Shawn8901 marked this pull request as ready for review January 2, 2026 20:40
@vic
Copy link
Owner

vic commented Jan 4, 2026

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 ?

@Shawn8901
Copy link
Contributor Author

Shawn8901 commented Jan 4, 2026

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 vscode or discord as then just one should be contained in the unfree package list.

Should i also add an extra case for having it as nixosConfigurations?

@vic
Copy link
Owner

vic commented Jan 5, 2026

your changes look good, updating the previous test is correct .

@Shawn8901
Copy link
Contributor Author

Shawn8901 commented Jan 5, 2026

Thx for the feedback.
I'll check the ci failure later, today evening

@Shawn8901 Shawn8901 force-pushed the main branch 2 times, most recently from 22b9a66 to f859600 Compare January 5, 2026 20:17
@Shawn8901
Copy link
Contributor Author

Thx for the feedback. I'll check the ci failure later, today evening

I hope the CI issue should be fixed now

@vic
Copy link
Owner

vic commented Jan 5, 2026

awesome work @Shawn8901!, looking good, just added a minor comment.

@Shawn8901 Shawn8901 force-pushed the main branch 2 times, most recently from c586878 to 245796f Compare January 5, 2026 20:34
@Shawn8901
Copy link
Contributor Author

Shawn8901 commented Jan 5, 2026

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.
@vic vic merged commit d56667d into vic:main Jan 14, 2026
9 of 11 checks passed
@vic
Copy link
Owner

vic commented Jan 14, 2026

Thanks @Shawn8901

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

Successfully merging this pull request may close these issues.

2 participants