Color: Don't generate unnecessary sub-options
This commit is contained in:
@ -5,25 +5,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules; let
|
with mylib.modules; {
|
||||||
mkColorOption = key: {
|
|
||||||
light.${key} = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
description = "The RGB hex color value for ${key} in the light scheme";
|
|
||||||
example = "EEEEEE";
|
|
||||||
};
|
|
||||||
dark.${key} = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
description = "The RGB hex color value for ${key} in the dark scheme";
|
|
||||||
example = "111111";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
(lib.pipe colorKeys [
|
|
||||||
(builtins.map mkColorOption)
|
|
||||||
lib.mergeAttrsList
|
|
||||||
])
|
|
||||||
// {
|
|
||||||
enable = mkEnableOption "Enable color schemes";
|
enable = mkEnableOption "Enable color schemes";
|
||||||
|
|
||||||
lightScheme = mkOption {
|
lightScheme = mkOption {
|
||||||
|
Reference in New Issue
Block a user