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