stylix/mk-target: rename generalConfig argument to unconditionalConfig

Rename the generalConfig argument to unconditionalConfig to better imply
the intentional lack of safeguarding.
This commit is contained in:
NAHO 2025-07-19 11:28:34 +02:00
parent f7b554dea9
commit 76d05fd9c0
No known key found for this signature in database
GPG key ID: BFB5D5E3F4C95185

View file

@ -22,7 +22,7 @@
name = "«name»"; name = "«name»";
humanName = "«human readable name»"; humanName = "«human readable name»";
generalConfig = unconditionalConfig =
lib.mkIf complexCondition { lib.mkIf complexCondition {
home.packages = [ pkgs.hello ]; home.packages = [ pkgs.hello ];
}; };
@ -125,14 +125,14 @@
{ extension.enable = lib.mkEnableOption "the bloated dependency"; } { extension.enable = lib.mkEnableOption "the bloated dependency"; }
``` ```
`generalConfig` (Attribute set or function or path)   `imports` (List)
  : The `imports` option forwarded to the Nixpkgs module system.
`unconditionalConfig` (Attribute set or function or path)
: This argument mirrors the `configElements` argument but intentionally : This argument mirrors the `configElements` argument but intentionally
lacks automatic safeguarding and should only be used for complex lacks automatic safeguarding and should only be used for complex
configurations where `configElements` is unsuitable. configurations where `configElements` is unsuitable.
  `imports` (List)
  : The `imports` option forwarded to the Nixpkgs module system.
# Environment # Environment
The function is provided alongside module arguments in any modules imported The function is provided alongside module arguments in any modules imported
@ -149,7 +149,7 @@
# name = "example"; # name = "example";
# humanName = "Example Target"; # humanName = "Example Target";
# #
# generalConfig = # unconditionalConfig =
# { lib, pkgs }: # { lib, pkgs }:
# lib.mkIf complexCondition { # lib.mkIf complexCondition {
# home.packages = [ pkgs.hello ]; # home.packages = [ pkgs.hello ];
@ -182,8 +182,8 @@
configElements ? [ ], configElements ? [ ],
enableExample ? null, enableExample ? null,
extraOptions ? { }, extraOptions ? { },
generalConfig ? { },
imports ? [ ], imports ? [ ],
unconditionalConfig ? { },
}@args: }@args:
let let
module = module =
@ -269,7 +269,7 @@ let
config = lib.mkIf (config.stylix.enable && cfg.enable) ( config = lib.mkIf (config.stylix.enable && cfg.enable) (
lib.mkMerge ( lib.mkMerge (
lib.singleton (callModule false generalConfig) lib.singleton (callModule false unconditionalConfig)
++ map (callModule true) (lib.toList configElements) ++ map (callModule true) (lib.toList configElements)
) )
); );