Skip to content

[release-25.11] stylix/mk-target: polish, simplify, and extend interface#2082

Merged
0xda157 merged 10 commits intonix-community:release-25.11from
trueNAHO:backport-1721-to-release-25.11
Dec 10, 2025
Merged

[release-25.11] stylix/mk-target: polish, simplify, and extend interface#2082
0xda157 merged 10 commits intonix-community:release-25.11from
trueNAHO:backport-1721-to-release-25.11

Conversation

@trueNAHO
Copy link
Copy Markdown
Member

Manual backport of #1721.

I suppose this is safe to merge once CI passes.


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)
@stylix-automation stylix-automation bot added topic: documentation Documentation additions or improvements topic: nixos NixOS target topic: home-manager Home Manager target topic: darwin nix-darwin target topic: droid Nix-on-Droid target topic: overlay Overlay changes topic: modules /modules/ subsystem topic: stylix /stylix/ subsystem labels Dec 10, 2025
@trueNAHO trueNAHO changed the title stylix/mk-target: polish, simplify, and extend interface [release-25.11] stylix/mk-target: polish, simplify, and extend interface Dec 10, 2025
@0xda157 0xda157 merged commit 93f0ee1 into nix-community:release-25.11 Dec 10, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: darwin nix-darwin target topic: documentation Documentation additions or improvements topic: droid Nix-on-Droid target topic: home-manager Home Manager target topic: modules /modules/ subsystem topic: nixos NixOS target topic: overlay Overlay changes topic: stylix /stylix/ subsystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants