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)") (cherry picked from commit1272e6858e)
This commit is contained in:
parent
4ec8181cd8
commit
66576c1e09
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue