lib/keymaps: make mode type's description more readable

Only list the enum values once, instead of twice.
This commit is contained in:
Matt Sturgeon 2025-02-15 14:19:56 +00:00
parent bd46d896a8
commit b8c5587399
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -44,6 +44,15 @@ rec {
modeEnum = lib.types.enum modes;
modeType =
with lib.types;
either modeEnum (nonEmptyListOf modeEnum)
// {
description =
"one of or non-empty list of" + lib.strings.removePrefix "one of" modeEnum.description;
descriptionClass = "conjunction";
};
mapOptionSubmodule = mkMapOptionSubmodule { };
# NOTE: options that have the deprecated `lua` sub-option must use `removeDeprecatedMapAttrs`
@ -55,7 +64,7 @@ rec {
mkModeOption =
default:
lib.mkOption {
type = with lib.types; either modeEnum (listOf modeEnum);
type = modeType;
description = ''
One or several modes.
Use the short-names (`"n"`, `"v"`, ...).