[release-25.11] stylix/mk-target: polish, simplify, and extend interface#2082
Merged
0xda157 merged 10 commits intonix-community:release-25.11from Dec 10, 2025
Merged
Conversation
(cherry picked from commit a4ffbc2)
(cherry picked from commit 25354cc)
Fixes: 093087e ("stylix: add imports to mkTarget (nix-community#1363)") (cherry picked from commit 9afd823)
Rename the mkConfig function to callModule to generalize the name beyond the specific config and options module arguments. Fixes: dea0337 ("stylix: restrict access to config while using mkTarget (nix-community#1368)") (cherry picked from commit 1272e68)
Polish the mkTarget implementation to improve error reporting and simplify future enhancements. Configuration elements can now recursively resolve to paths. (cherry picked from commit f7b554d)
Rename the generalConfig argument to unconditionalConfig to better imply the intentional lack of safeguarding. (cherry picked from commit 76d05fd)
Rename mkTarget's 'configElements' argument to 'config' and 'extraOptions' to 'options' to provide a more transparent interface with the underlying Nixpkgs module system. (cherry picked from commit 16df6b8)
Optionalize mkTarget's 'humanName' and 'name' arguments by inferring 'humanName' from the 'name' attribute in the /modules/<MODULE>/meta.nix file, and 'name' from the /modules/<NAME>/ directory name. Inferring the 'humanName' and 'name' arguments ensures consistency and reduces boilerplate. The 'humanName' and 'name' arguments are optionalized instead of removed because complex modules generating target derivations need to distinguish between them. Closes: nix-community#1661 (cherry picked from commit dfc859f)
Generate targets.${target}.${argument}.enable and
targets.${target}.${argument}.override options for disabling and
configuring safeguarded arguments on a target level.
(cherry picked from commit 953c3fb)
Normalize the options argument identically to config to provide a coherent and extensible options interface. (cherry picked from commit 6153df3)
0xda157
approved these changes
Dec 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual backport of #1721.
I suppose this is safe to merge once CI passes.