Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 1 | { |
| 2 | pkgs, |
| 3 | config, |
| 4 | lib, |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 5 | inputs, |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 6 | ... |
| 7 | }: |
| 8 | { |
| 9 | options.chimera.theme = { |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 10 | font = { |
| 11 | mono = lib.mkOption { |
| 12 | type = inputs.home-manager.lib.hm.types.fontType; |
| 13 | description = "Mono width font to use as system default"; |
| 14 | default = { |
| 15 | name = "FiraCode"; |
| 16 | package = pkgs.fira-code; |
| 17 | size = 12; |
| 18 | }; |
| 19 | }; |
| 20 | variableWidth = { |
| 21 | serif = lib.mkOption { |
| 22 | type = inputs.home-manager.lib.hm.types.fontType; |
| 23 | description = "Serif variable width font to use as system default"; |
| 24 | default = { |
| 25 | name = "Roboto Serif"; |
| 26 | package = pkgs.roboto-serif; |
| 27 | size = 12; |
| 28 | }; |
| 29 | }; |
| 30 | sansSerif = lib.mkOption { |
| 31 | type = inputs.home-manager.lib.hm.types.fontType; |
| 32 | description = "Sans serif variable width font to use as system default"; |
| 33 | default = { |
| 34 | name = "Roboto"; |
| 35 | package = pkgs.roboto; |
| 36 | size = 12; |
| 37 | }; |
| 38 | }; |
| 39 | }; |
| 40 | emoji = lib.mkOption { |
| 41 | type = inputs.home-manager.lib.hm.types.fontType; |
| 42 | description = "Emoji's to use as system default"; |
| 43 | default = { |
| 44 | name = "Twitter Color Emoji"; |
| 45 | package = pkgs.twitter-color-emoji; |
| 46 | size = 12; |
| 47 | }; |
| 48 | }; |
| 49 | nerdFontGlyphs.enable = lib.mkEnableOption "Enable Nerd Font Glyphs"; |
| 50 | extraFonts = lib.mkOption { |
| 51 | type = lib.types.listOf inputs.home-manager.lib.hm.types.fontType; |
| 52 | description = "Extra fonts to install"; |
| 53 | default = [ ]; |
| 54 | }; |
| 55 | }; |
| 56 | |
| 57 | cursor = lib.mkOption { |
| 58 | type = lib.types.nullOr ( |
| 59 | lib.types.submodule { |
| 60 | options = { |
| 61 | package = lib.mkOption { |
| 62 | type = lib.types.package; |
| 63 | example = lib.literalExpression "pkgs.vanilla-dmz"; |
| 64 | description = "Package providing the cursor theme"; |
| 65 | }; |
| 66 | |
| 67 | name = lib.mkOption { |
| 68 | type = lib.types.str; |
| 69 | example = "Vanilla-DMZ"; |
| 70 | description = "The cursor name within the package"; |
| 71 | }; |
| 72 | |
| 73 | size = lib.mkOption { |
| 74 | type = lib.types.int; |
| 75 | default = 32; |
| 76 | example = 64; |
| 77 | description = "The cursor size"; |
| 78 | }; |
| 79 | }; |
| 80 | } |
| 81 | ); |
| 82 | description = "Cursor settings"; |
| 83 | default = null; |
| 84 | }; |
| 85 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 86 | colors = |
| 87 | let |
Skyler Grey | b9d8b87 | 2024-02-15 19:02:36 +0000 | [diff] [blame] | 88 | themeColor = lib.types.submodule { |
| 89 | options = { |
| 90 | hex = lib.mkOption { |
| 91 | type = lib.types.str; |
| 92 | }; |
| 93 | rgb = { |
| 94 | r = lib.mkOption { |
| 95 | type = lib.types.numbers 0 255; |
| 96 | }; |
| 97 | g = lib.mkOption { |
| 98 | type = lib.types.numbers 0 255; |
| 99 | }; |
| 100 | b = lib.mkOption { |
| 101 | type = lib.types.numbers 0 255; |
| 102 | }; |
| 103 | }; |
| 104 | hsl = { |
| 105 | h = lib.mkOption { |
| 106 | type = lib.types.numbers 0 360; |
| 107 | }; |
| 108 | s = lib.mkOption { |
| 109 | type = lib.types.numbers 0 100; |
| 110 | }; |
| 111 | l = lib.mkOption { |
| 112 | type = lib.types.numbers 0 100; |
| 113 | }; |
| 114 | }; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 115 | }; |
| 116 | }; |
| 117 | in |
| 118 | { |
| 119 | Rosewater = lib.mkOption { type = themeColor; }; |
| 120 | Flamingo = lib.mkOption { type = themeColor; }; |
| 121 | Pink = lib.mkOption { type = themeColor; }; |
| 122 | Mauve = lib.mkOption { type = themeColor; }; |
| 123 | Red = lib.mkOption { type = themeColor; }; |
| 124 | Maroon = lib.mkOption { type = themeColor; }; |
| 125 | Peach = lib.mkOption { type = themeColor; }; |
| 126 | Yellow = lib.mkOption { type = themeColor; }; |
| 127 | Green = lib.mkOption { type = themeColor; }; |
| 128 | Teal = lib.mkOption { type = themeColor; }; |
| 129 | Sky = lib.mkOption { type = themeColor; }; |
| 130 | Sapphire = lib.mkOption { type = themeColor; }; |
| 131 | Blue = lib.mkOption { type = themeColor; }; |
| 132 | Lavender = lib.mkOption { type = themeColor; }; |
| 133 | Text = lib.mkOption { type = themeColor; }; |
| 134 | Subtext1 = lib.mkOption { type = themeColor; }; |
| 135 | Subtext0 = lib.mkOption { type = themeColor; }; |
| 136 | Overlay2 = lib.mkOption { type = themeColor; }; |
| 137 | Overlay1 = lib.mkOption { type = themeColor; }; |
| 138 | Overlay0 = lib.mkOption { type = themeColor; }; |
| 139 | Surface2 = lib.mkOption { type = themeColor; }; |
| 140 | Surface1 = lib.mkOption { type = themeColor; }; |
| 141 | Surface0 = lib.mkOption { type = themeColor; }; |
| 142 | Base = lib.mkOption { type = themeColor; }; |
| 143 | Mantle = lib.mkOption { type = themeColor; }; |
| 144 | Crust = lib.mkOption { type = themeColor; }; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 145 | Accent = lib.mkOption { type = themeColor; }; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 146 | }; |
| 147 | }; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 148 | |
| 149 | config = { |
| 150 | |
| 151 | fonts.fontconfig.enable = true; |
| 152 | |
| 153 | home.packages = |
| 154 | [ |
| 155 | config.chimera.theme.font.mono.package |
| 156 | config.chimera.theme.font.variableWidth.serif.package |
| 157 | config.chimera.theme.font.variableWidth.sansSerif.package |
| 158 | config.chimera.theme.font.emoji.package |
| 159 | ] |
| 160 | ++ ( |
| 161 | if config.chimera.theme.font.nerdFontGlyphs.enable then |
| 162 | [ (pkgs.nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) ] |
| 163 | else |
| 164 | [ ] |
| 165 | ) |
| 166 | ++ config.chimera.theme.font.extraFonts; |
| 167 | |
| 168 | home.pointerCursor = lib.mkIf (config.chimera.theme.cursor != null) { |
| 169 | name = config.chimera.theme.cursor.name; |
| 170 | package = config.chimera.theme.cursor.package; |
| 171 | size = config.chimera.theme.cursor.size; |
| 172 | gtk.enable = true; # TODO: should we factor this out into a gtk module when we come to that? |
| 173 | x11.enable = true; |
| 174 | }; |
| 175 | }; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 176 | } |