lib/languages: move mkEnable up & add desc comment

This commit is contained in:
raf 2024-07-04 17:36:07 +03:00
parent b4c06c71dc
commit ecbaecfeac
Signed by: NotAShelf
GPG key ID: AF26552424E53993

View file

@ -5,6 +5,15 @@
inherit (lib.attrsets) listToAttrs; inherit (lib.attrsets) listToAttrs;
inherit (lib.types) bool; inherit (lib.types) bool;
in { in {
# A wrapper around `mkOption` to create a boolean option that is
# used for Language Server modules.
mkEnable = desc:
mkOption {
description = "Turn on ${desc} for enabled languages by default";
type = bool;
default = false;
};
# Converts a boolean to a yes/no string. This is used in lots of # Converts a boolean to a yes/no string. This is used in lots of
# configuration formats. # configuration formats.
diagnosticsToLua = { diagnosticsToLua = {
@ -27,11 +36,4 @@ in {
value = diagnosticsProviders.${type}.nullConfig package; value = diagnosticsProviders.${type}.nullConfig package;
}) })
config); config);
mkEnable = desc:
mkOption {
description = "Turn on ${desc} for enabled languages by default";
type = bool;
default = false;
};
} }