From 030af3e0717e32b8c0c0133d17bcba8659d2d1b2 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Mon, 10 Jun 2024 20:33:08 +0100 Subject: [PATCH] stylix: remove `cfg.enable` from `mkEnableTarget` default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The global `stylix.enable` option is not relevant to the per-target `enable` option's default. The individual modules should already be gated behind `stylix.enable`, so there is no need for it to also affect the value of `stylix.targets.«name».enable`. This should not produce any change in behavior for correctly written modules. --- To give a concrete example: ```nix { stylix.enable = false; stylix.autoEnable = true; stylix.targets.foo.enable = true; } ``` Here, the `stylix.enable` option is set to `false`, so no targets should be enabled, regardless of their per-target `enable` option's value. However if the `foo` target assumes it only needs to read its own `enable` option, in this example it would define its config even though Stylix is disabled globally. --- stylix/target.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stylix/target.nix b/stylix/target.nix index 12b8494b..1074acb3 100644 --- a/stylix/target.nix +++ b/stylix/target.nix @@ -40,7 +40,7 @@ humanName: autoEnable: lib.mkEnableOption "theming for ${humanName}" // { - default = cfg.enable && cfg.autoEnable && autoEnable; + default = cfg.autoEnable && autoEnable; example = !autoEnable; } // lib.optionalAttrs autoEnable {