mirror of
https://github.com/danth/stylix
synced 2024-11-10 06:34:15 +00:00
stylix: standardize autoEnable
and mkEnableTarget
documentation (#398)
This commit is contained in:
parent
ebaed9d4bf
commit
99bcaa5520
1 changed files with 19 additions and 21 deletions
|
@ -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`.
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue