stylix: standardize autoEnable and mkEnableTarget documentation (#398)

This commit is contained in:
NAHO 2024-06-01 02:27:50 +02:00 committed by GitHub
parent ebaed9d4bf
commit 99bcaa5520
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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`.
'';
};
}