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 = { |
Skyler Grey | ec50d24 | 2024-02-15 23:09:46 +0000 | [diff] [blame] | 90 | hex = lib.mkOption { type = lib.types.str; }; |
Skyler Grey | b9d8b87 | 2024-02-15 19:02:36 +0000 | [diff] [blame] | 91 | rgb = { |
Skyler Grey | ec50d24 | 2024-02-15 23:09:46 +0000 | [diff] [blame] | 92 | r = lib.mkOption { type = lib.types.numbers 0 255; }; |
| 93 | g = lib.mkOption { type = lib.types.numbers 0 255; }; |
| 94 | b = lib.mkOption { type = lib.types.numbers 0 255; }; |
Skyler Grey | b9d8b87 | 2024-02-15 19:02:36 +0000 | [diff] [blame] | 95 | }; |
| 96 | hsl = { |
Skyler Grey | ec50d24 | 2024-02-15 23:09:46 +0000 | [diff] [blame] | 97 | h = lib.mkOption { type = lib.types.numbers 0 360; }; |
| 98 | s = lib.mkOption { type = lib.types.numbers 0 100; }; |
| 99 | l = lib.mkOption { type = lib.types.numbers 0 100; }; |
Skyler Grey | b9d8b87 | 2024-02-15 19:02:36 +0000 | [diff] [blame] | 100 | }; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 101 | }; |
| 102 | }; |
| 103 | in |
| 104 | { |
| 105 | Rosewater = lib.mkOption { type = themeColor; }; |
| 106 | Flamingo = lib.mkOption { type = themeColor; }; |
| 107 | Pink = lib.mkOption { type = themeColor; }; |
| 108 | Mauve = lib.mkOption { type = themeColor; }; |
| 109 | Red = lib.mkOption { type = themeColor; }; |
| 110 | Maroon = lib.mkOption { type = themeColor; }; |
| 111 | Peach = lib.mkOption { type = themeColor; }; |
| 112 | Yellow = lib.mkOption { type = themeColor; }; |
| 113 | Green = lib.mkOption { type = themeColor; }; |
| 114 | Teal = lib.mkOption { type = themeColor; }; |
| 115 | Sky = lib.mkOption { type = themeColor; }; |
| 116 | Sapphire = lib.mkOption { type = themeColor; }; |
| 117 | Blue = lib.mkOption { type = themeColor; }; |
| 118 | Lavender = lib.mkOption { type = themeColor; }; |
| 119 | Text = lib.mkOption { type = themeColor; }; |
| 120 | Subtext1 = lib.mkOption { type = themeColor; }; |
| 121 | Subtext0 = lib.mkOption { type = themeColor; }; |
| 122 | Overlay2 = lib.mkOption { type = themeColor; }; |
| 123 | Overlay1 = lib.mkOption { type = themeColor; }; |
| 124 | Overlay0 = lib.mkOption { type = themeColor; }; |
| 125 | Surface2 = lib.mkOption { type = themeColor; }; |
| 126 | Surface1 = lib.mkOption { type = themeColor; }; |
| 127 | Surface0 = lib.mkOption { type = themeColor; }; |
| 128 | Base = lib.mkOption { type = themeColor; }; |
| 129 | Mantle = lib.mkOption { type = themeColor; }; |
| 130 | Crust = lib.mkOption { type = themeColor; }; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 131 | Accent = lib.mkOption { type = themeColor; }; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 132 | }; |
| 133 | }; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 134 | |
| 135 | config = { |
| 136 | |
| 137 | fonts.fontconfig.enable = true; |
| 138 | |
| 139 | home.packages = |
| 140 | [ |
| 141 | config.chimera.theme.font.mono.package |
| 142 | config.chimera.theme.font.variableWidth.serif.package |
| 143 | config.chimera.theme.font.variableWidth.sansSerif.package |
| 144 | config.chimera.theme.font.emoji.package |
| 145 | ] |
| 146 | ++ ( |
| 147 | if config.chimera.theme.font.nerdFontGlyphs.enable then |
| 148 | [ (pkgs.nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) ] |
| 149 | else |
| 150 | [ ] |
| 151 | ) |
| 152 | ++ config.chimera.theme.font.extraFonts; |
| 153 | |
| 154 | home.pointerCursor = lib.mkIf (config.chimera.theme.cursor != null) { |
| 155 | name = config.chimera.theme.cursor.name; |
| 156 | package = config.chimera.theme.cursor.package; |
| 157 | size = config.chimera.theme.cursor.size; |
Samuel Shuert | 2fd2bb5 | 2024-02-23 18:30:10 +0000 | [diff] [blame] | 158 | gtk.enable = true; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 159 | x11.enable = true; |
| 160 | }; |
| 161 | }; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 162 | } |