stylix/mk-target: rename mkConfig function to callModule

Rename the mkConfig function to callModule to generalize the name beyond
the specific config and options module arguments.

Fixes: dea0337e0b ("stylix: restrict access to config while using mkTarget (#1368)")
This commit is contained in:
NAHO 2025-11-21 20:12:08 +01:00
parent 9afd8230cd
commit 1272e6858e
No known key found for this signature in database
GPG key ID: BFB5D5E3F4C95185

View file

@ -217,7 +217,7 @@ let
);
# Call the configuration function with its required Stylix arguments.
mkConfig = fn: fn (getStylixAttrs fn);
callModule = fn: fn (getStylixAttrs fn);
# Safeguard configuration functions when any of their arguments is
# disabled.
@ -232,13 +232,13 @@ let
(builtins.all (attr: attr.enable or (attr != null)))
];
in
lib.mkIf allAttrsEnabled (mkConfig c)
lib.mkIf allAttrsEnabled (callModule c)
else
c;
in
{
imports = imports ++ [
{ options.stylix.targets.${name} = mkConfig (lib.toFunction extraOptions); }
{ options.stylix.targets.${name} = callModule (lib.toFunction extraOptions); }
];
options.stylix.targets.${name}.enable =
@ -258,7 +258,7 @@ let
config = lib.mkIf (config.stylix.enable && cfg.enable) (
lib.mkMerge (
lib.optional (generalConfig != null) (
mkConfig (
callModule (
if builtins.isPath generalConfig then import generalConfig else generalConfig
)
)