Skip to content

Commit

Permalink
stylix: standardize autoEnable and mkEnableTarget documentation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
trueNAHO authored Jun 1, 2024
1 parent ebaed9d commit 99bcaa5
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions stylix/target.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`.
'';
};
}

0 comments on commit 99bcaa5

Please sign in to comment.