diff --git a/stylix/target.nix b/stylix/target.nix index 8f0c1f02..0ff57da3 100644 --- a/stylix/target.nix +++ b/stylix/target.nix @@ -2,14 +2,14 @@ with lib; -let - fromOs = import ./fromos.nix { inherit lib args; }; -in { - options.stylix.autoEnable = mkOption { - description = "Whether to automatically enable styling for installed targets."; - type = types.bool; - default = fromOs [ "autoEnable" ] true; - }; +{ + options.stylix.autoEnable = + mkEnableOption + "styling installed targets" + // { + default = import ./fromos.nix { inherit lib args; } [ "autoEnable" ] true; + example = false; + }; config.lib.stylix.mkEnableTarget = humanName: @@ -23,18 +23,16 @@ in { # If some manual setup is required, or the module leads to the target # being installed if it wasn't already, set this to `false`. autoEnable: + mkEnableOption + "styling for ${humanName}" + // { + default = config.stylix.autoEnable && autoEnable; - mkOption { - description = "Whether to style ${humanName}."; - type = types.bool; - - # We can't substitute the target name into this description because some - # don't make sense: "if the desktop background using Feh is installed" - defaultText = literalMD '' - `true` if `stylix.autoEnable == true` and the target is installed, - otherwise `false`. - ''; - - default = config.stylix.autoEnable && autoEnable; - }; + # We can't substitute the target name into this description because some + # don't make sense: "if the desktop background using Feh is installed" + defaultText = literalMD '' + `true` if `stylix.autoEnable == true` and the target is installed, + otherwise `false`. + ''; + }; }