blob: cf01310452d4b000608d882d35f75b1caaa0025c [file] [log] [blame]
Skyler Grey4e230892024-02-13 22:58:46 +00001{
2 pkgs,
3 config,
4 lib,
Samuel Shuert02ffd1e2024-02-13 21:37:15 -05005 inputs,
Skyler Grey4e230892024-02-13 22:58:46 +00006 ...
7}:
8{
9 options.chimera.theme = {
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050010 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 Greya57de852024-03-09 12:11:02 +000086 style = lib.mkOption {
87 type = lib.types.enum [
88 "Light"
89 "Dark"
90 ];
91 description = "Whether this theme prefers to match with light or dark color schemes";
92 };
93
Skyler Grey4e230892024-02-13 22:58:46 +000094 colors =
95 let
Skyler Greyb9d8b872024-02-15 19:02:36 +000096 themeColor = lib.types.submodule {
97 options = {
Skyler Greyec50d242024-02-15 23:09:46 +000098 hex = lib.mkOption { type = lib.types.str; };
Skyler Greyb9d8b872024-02-15 19:02:36 +000099 rgb = {
Skyler Greyec50d242024-02-15 23:09:46 +0000100 r = lib.mkOption { type = lib.types.numbers 0 255; };
101 g = lib.mkOption { type = lib.types.numbers 0 255; };
102 b = lib.mkOption { type = lib.types.numbers 0 255; };
Skyler Greyb9d8b872024-02-15 19:02:36 +0000103 };
104 hsl = {
Skyler Greyec50d242024-02-15 23:09:46 +0000105 h = lib.mkOption { type = lib.types.numbers 0 360; };
106 s = lib.mkOption { type = lib.types.numbers 0 100; };
107 l = lib.mkOption { type = lib.types.numbers 0 100; };
Skyler Greyb9d8b872024-02-15 19:02:36 +0000108 };
Skyler Grey4e230892024-02-13 22:58:46 +0000109 };
110 };
111 in
112 {
113 Rosewater = lib.mkOption { type = themeColor; };
114 Flamingo = lib.mkOption { type = themeColor; };
115 Pink = lib.mkOption { type = themeColor; };
116 Mauve = lib.mkOption { type = themeColor; };
117 Red = lib.mkOption { type = themeColor; };
118 Maroon = lib.mkOption { type = themeColor; };
119 Peach = lib.mkOption { type = themeColor; };
120 Yellow = lib.mkOption { type = themeColor; };
121 Green = lib.mkOption { type = themeColor; };
122 Teal = lib.mkOption { type = themeColor; };
123 Sky = lib.mkOption { type = themeColor; };
124 Sapphire = lib.mkOption { type = themeColor; };
125 Blue = lib.mkOption { type = themeColor; };
126 Lavender = lib.mkOption { type = themeColor; };
127 Text = lib.mkOption { type = themeColor; };
128 Subtext1 = lib.mkOption { type = themeColor; };
129 Subtext0 = lib.mkOption { type = themeColor; };
130 Overlay2 = lib.mkOption { type = themeColor; };
131 Overlay1 = lib.mkOption { type = themeColor; };
132 Overlay0 = lib.mkOption { type = themeColor; };
133 Surface2 = lib.mkOption { type = themeColor; };
134 Surface1 = lib.mkOption { type = themeColor; };
135 Surface0 = lib.mkOption { type = themeColor; };
136 Base = lib.mkOption { type = themeColor; };
137 Mantle = lib.mkOption { type = themeColor; };
138 Crust = lib.mkOption { type = themeColor; };
Samuel Shuert02ffd1e2024-02-13 21:37:15 -0500139 Accent = lib.mkOption { type = themeColor; };
Skyler Grey4e230892024-02-13 22:58:46 +0000140 };
141 };
Samuel Shuert02ffd1e2024-02-13 21:37:15 -0500142
143 config = {
144
145 fonts.fontconfig.enable = true;
146
147 home.packages =
148 [
149 config.chimera.theme.font.mono.package
150 config.chimera.theme.font.variableWidth.serif.package
151 config.chimera.theme.font.variableWidth.sansSerif.package
152 config.chimera.theme.font.emoji.package
153 ]
154 ++ (
155 if config.chimera.theme.font.nerdFontGlyphs.enable then
156 [ (pkgs.nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) ]
157 else
158 [ ]
159 )
160 ++ config.chimera.theme.font.extraFonts;
161
162 home.pointerCursor = lib.mkIf (config.chimera.theme.cursor != null) {
163 name = config.chimera.theme.cursor.name;
164 package = config.chimera.theme.cursor.package;
165 size = config.chimera.theme.cursor.size;
Samuel Shuert2fd2bb52024-02-23 18:30:10 +0000166 gtk.enable = true;
Samuel Shuert02ffd1e2024-02-13 21:37:15 -0500167 x11.enable = true;
168 };
169 };
Skyler Grey4e230892024-02-13 22:58:46 +0000170}