lib/languages: move mkEnable up & add desc comment

This commit is contained in:
NotAShelf 2024-07-04 17:36:07 +03:00
parent b4c06c71dc
commit ecbaecfeac
No known key found for this signature in database
GPG key ID: AF26552424E53993

View file

@ -5,6 +5,15 @@
inherit (lib.attrsets) listToAttrs;
inherit (lib.types) bool;
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
# configuration formats.
diagnosticsToLua = {
@ -27,11 +36,4 @@ in {
value = diagnosticsProviders.${type}.nullConfig package;
})
config);
mkEnable = desc:
mkOption {
description = "Turn on ${desc} for enabled languages by default";
type = bool;
default = false;
};
}