diff --git a/home/modules/color/default.nix b/home/modules/color/default.nix index aab2971b..72c94979 100644 --- a/home/modules/color/default.nix +++ b/home/modules/color/default.nix @@ -5,46 +5,16 @@ ... }: let inherit (config.modules) color; - - # Options and assignments will be generated from those keys - colorKeys = [ - # Colors - "rosewater" - "flamingo" - "pink" - "mauve" - "red" - "maroon" - "peach" - "yellow" - "green" - "teal" - "sky" - "sapphire" - "blue" - "lavender" - - # 50 shades of gray - "text" - "subtext1" - "subtext0" - "overlay2" - "overlay1" - "overlay0" - "surface2" - "surface1" - "surface0" - "base" - "mantle" - "crust" - ]; in { - options.modules.color = import ./options.nix {inherit lib mylib colorKeys;}; + options.modules.color = import ./options.nix {inherit lib mylib;}; config = let lightDefs = import ./schemes/${color.lightScheme}.nix; darkDefs = import ./schemes/${color.darkScheme}.nix; + # Assignments will be generated from those keys + colorKeys = builtins.attrNames lightDefs; + mkColorAssignment = defs: key: {${key} = defs.${key};}; mkRgbColorAssignment = defs: key: {${key} = mylib.color.hexToRGB defs.${key};}; mkRgbStringColorAssignment = defs: key: {${key} = mylib.color.hexToRGBString "," defs.${key};}; diff --git a/home/modules/color/options.nix b/home/modules/color/options.nix index 9f785c10..5e0a6bc4 100644 --- a/home/modules/color/options.nix +++ b/home/modules/color/options.nix @@ -1,7 +1,6 @@ { lib, mylib, - colorKeys, ... }: with lib; @@ -29,13 +28,7 @@ with mylib.modules; { default = "JetBrainsMono Nerd Font Mono"; }; - # Internal-only options - - keys = mkOption { - type = types.listOf types.str; - description = "The names of all possible colors"; - default = colorKeys; - }; + # These options will be populated automatically. hex = mkOption { type = types.attrs;