blob: 11478c8c7a97239ed12302a616de125aeb88671f [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 Grey4e230892024-02-13 22:58:46 +000086 colors =
87 let
88 themeColor = {
89 hex = lib.types.str;
90 rgb = {
91 r = lib.types.numbers 0 255;
92 g = lib.types.numbers 0 255;
93 b = lib.types.numbers 0 255;
94 };
95 hsl = {
96 h = lib.types.numbers 0 360;
97 s = lib.types.numbers 0 100;
98 l = lib.types.numbers 0 100;
99 };
100 };
101 in
102 {
103 Rosewater = lib.mkOption { type = themeColor; };
104 Flamingo = lib.mkOption { type = themeColor; };
105 Pink = lib.mkOption { type = themeColor; };
106 Mauve = lib.mkOption { type = themeColor; };
107 Red = lib.mkOption { type = themeColor; };
108 Maroon = lib.mkOption { type = themeColor; };
109 Peach = lib.mkOption { type = themeColor; };
110 Yellow = lib.mkOption { type = themeColor; };
111 Green = lib.mkOption { type = themeColor; };
112 Teal = lib.mkOption { type = themeColor; };
113 Sky = lib.mkOption { type = themeColor; };
114 Sapphire = lib.mkOption { type = themeColor; };
115 Blue = lib.mkOption { type = themeColor; };
116 Lavender = lib.mkOption { type = themeColor; };
117 Text = lib.mkOption { type = themeColor; };
118 Subtext1 = lib.mkOption { type = themeColor; };
119 Subtext0 = lib.mkOption { type = themeColor; };
120 Overlay2 = lib.mkOption { type = themeColor; };
121 Overlay1 = lib.mkOption { type = themeColor; };
122 Overlay0 = lib.mkOption { type = themeColor; };
123 Surface2 = lib.mkOption { type = themeColor; };
124 Surface1 = lib.mkOption { type = themeColor; };
125 Surface0 = lib.mkOption { type = themeColor; };
126 Base = lib.mkOption { type = themeColor; };
127 Mantle = lib.mkOption { type = themeColor; };
128 Crust = lib.mkOption { type = themeColor; };
Samuel Shuert02ffd1e2024-02-13 21:37:15 -0500129 Accent = lib.mkOption { type = themeColor; };
Skyler Grey4e230892024-02-13 22:58:46 +0000130 };
131 };
Samuel Shuert02ffd1e2024-02-13 21:37:15 -0500132
133 config = {
134
135 fonts.fontconfig.enable = true;
136
137 home.packages =
138 [
139 config.chimera.theme.font.mono.package
140 config.chimera.theme.font.variableWidth.serif.package
141 config.chimera.theme.font.variableWidth.sansSerif.package
142 config.chimera.theme.font.emoji.package
143 ]
144 ++ (
145 if config.chimera.theme.font.nerdFontGlyphs.enable then
146 [ (pkgs.nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) ]
147 else
148 [ ]
149 )
150 ++ config.chimera.theme.font.extraFonts;
151
152 home.pointerCursor = lib.mkIf (config.chimera.theme.cursor != null) {
153 name = config.chimera.theme.cursor.name;
154 package = config.chimera.theme.cursor.package;
155 size = config.chimera.theme.cursor.size;
156 gtk.enable = true; # TODO: should we factor this out into a gtk module when we come to that?
157 x11.enable = true;
158 };
159 };
Skyler Grey4e230892024-02-13 22:58:46 +0000160}