colorizer: allow null for all options

This commit is contained in:
Ching Pei Yang 2024-05-12 01:43:03 +02:00
parent 2cec6178ab
commit ac97885f57

View file

@ -4,20 +4,59 @@
...
}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) attrsOf enum nullOr submodule;
inherit (lib.types) attrsOf enum nullOr submodule bool;
inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.nvim.config) mkBool;
settingSubmodule = submodule {
options = {
RGB = mkBool true "Colorize #RGB hex codes";
RRGGBB = mkBool true "Colorize #RRGGBB hex codes";
names = mkBool true ''Colorize "Name" codes like Blue'';
RRGGBBAA = mkBool false "Colorize #RRGGBBAA hex codes";
rgb_fn = mkBool false "Colorize CSS rgb() and rgba() functions";
hsl_fn = mkBool false "Colorize CSS hsl() and hsla() functions";
css = mkBool false "Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB";
css_fn = mkBool false "Enable all CSS *functions*: rgb_fn, hsl_fn";
RGB = mkOption {
description = "Colorize #RGB hex codes";
default = null;
type = nullOr bool;
};
RRGGBB = mkOption {
description = "Colorize #RRGGBB hex codes";
default = null;
type = nullOr bool;
};
names = mkOption {
description = ''Colorize "Name" codes like Blue'';
default = null;
type = nullOr bool;
};
RRGGBBAA = mkOption {
description = "Colorize #RRGGBBAA hex codes";
default = null;
type = nullOr bool;
};
rgb_fn = mkOption {
description = "Colorize CSS rgb() and rgba() functions";
default = null;
type = nullOr bool;
};
hsl_fn = mkOption {
description = "Colorize CSS hsl() and hsla() functions";
default = null;
type = nullOr bool;
};
css = mkOption {
description = "Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB";
default = null;
type = nullOr bool;
};
css_fn = mkOption {
description = "Enable all CSS *functions*: rgb_fn, hsl_fn";
default = null;
type = nullOr bool;
};
mode = mkOption {
description = "Set the display mode";
type = nullOr (enum ["foreground" "background"]);