-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
-
244
-
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
-
281
-
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
-
307
-
308
{ config, lib, pkgs, ... }:
let
cfg = config.themes.catppuccin;
radius = 6;
gap = 16;
in
{
options = {
themes.catppuccin = {
flavor = lib.mkOption {
type = lib.types.enum [
"latte"
"frappe"
"macchiato"
"mocha"
];
default = "mocha";
description = ''
Specify which Catppuccin _flavor_ (color palette) to use.
'';
};
};
};
config =
let
json = builtins.fromJSON (builtins.readFile (
pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "palette";
rev = "205dd54c6158b7648621cf9fd00e91f03888ce7e";
sha256 = "y14fd8lvnG9hNY6CRU0JgxWouexEw91aIEMkr1NaM/4=";
}
+ "/palette.json"
));
flavor = json."${cfg.flavor}";
stripSharp = hex: lib.strings.removePrefix "#" hex;
in
{
features.wayland-de = lib.mkIf config.features.wayland-de.enable {
niri = {
background-color = flavor.mantle.hex;
layout = {
focus-ring = {
width = gap / 4;
active-color = flavor.peach.hex;
inactive-color = flavor.surface0.hex;
};
gaps = gap;
struts.bottom = gap / -2;
};
window-rule-all = {
corner-radius = radius;
};
};
swaylock = {
flags = [
"color=${stripSharp flavor.base.hex}"
"indicator-thickness=8"
"indicator-idle-visible"
"inside-color=${stripSharp flavor.base.hex}"
"inside-clear-color=${stripSharp flavor.base.hex}"
"inside-ver-color=${stripSharp flavor.base.hex}"
"inside-wrong-color=${stripSharp flavor.base.hex}"
"key-hl-color=${stripSharp flavor.mauve.hex}"
"line-color=${stripSharp flavor.surface0.hex}"
"line-clear-color=${stripSharp flavor.surface0.hex}"
"line-ver-color=${stripSharp flavor.overlay2.hex}"
"line-wrong-color=${stripSharp flavor.red.hex}"
"ring-color=${stripSharp flavor.base.hex}"
"ring-clear-color=${stripSharp flavor.base.hex}"
"ring-ver-color=${stripSharp flavor.overlay0.hex}"
"ring-wrong-color=${stripSharp flavor.maroon.hex}"
"text-color=${stripSharp flavor.text.hex}"
"text-clear-color=${stripSharp flavor.text.hex}"
"text-ver-color=${stripSharp flavor.subtext1.hex}"
"text-wrong-color=${stripSharp flavor.red.hex}"
];
};
tofi = rec {
fuzzyMatch = false;
font = {
family = "Dank Mono";
size = 11;
};
scale = true;
anchor = "bottom";
horizontal = true;
# "100%" does not work on fractional scaling display
# https://github.com/philj56/tofi/issues/79
width = 0;
height = font.size + padding.top + padding.bottom + selection.backgroundPadding.top + selection.backgroundPadding.bottom + border.width * 2;
resultSpacing = 10 + selection.backgroundPadding.left + selection.backgroundPadding.right;
# Avoid unwanted clipping
# https://github.com/philj56/tofi/issues/65#issuecomment-1335556041
clipToPadding = false;
padding = {
top = 6;
right = 8;
# There is no way to specify line-height: need to adjust padding-bottom or something.
bottom = 5;
left = 8;
};
prompt = {
text = ">";
background = "#00000000";
color = flavor.teal.hex;
padding = 8;
};
input = {
color = flavor.subtext0.hex;
backgroundPadding = {
top = 0;
right = 32;
bottom = 0;
left = 0;
};
};
selection = {
background = flavor.surface2.hex + "66";
color = flavor.text.hex;
matchColor = flavor.peach.hex;
backgroundPadding = {
top = 4;
right = 8;
bottom = 4;
left = 8;
};
backgroundCornerRadius = 4;
};
textColor = flavor.text.hex;
backgroundColor = flavor.mantle.hex;
outline = {
width = 0;
color = "#00000000";
};
border = {
width = 0;
color = "#00000000";
};
};
};
services.dunst = lib.mkIf config.services.dunst.enable {
settings = {
global = {
width = 400;
height = 300;
offset = "4x4";
padding = 4;
horizontal_padding = 8;
frame_width = 2;
gap_size = 6;
font = "Monospace 10";
corner_radius = 2;
};
urgency_low = {
background = flavor.base.hex;
foreground = flavor.subtext0.hex;
frame_color = flavor.overlay1.hex;
};
urgency_normal = {
background = flavor.base.hex;
foreground = flavor.text.hex;
frame_color = flavor.blue.hex;
};
urgency_critical = {
background = flavor.base.hex;
foreground = flavor.text.hex;
frame_color = flavor.yellow.hex;
};
};
};
programs.waybar = lib.mkIf config.programs.waybar.enable {
settings = {
main = {
position = "bottom";
};
};
style = ''
* {
font-family: "FontAwesome", Roboto, Helvetica, Arial, sans-serif;
font-size: 16px;
}
window#waybar {
padding: ${builtins.toString gap}px;
background-color: transparent;
color: ${flavor.text.hex};
}
.modules-left,
.modules-right {
margin: 4px;
}
#workspaces button {
font-size: 12px;
padding: 0px 2px;
background-color: transparent;
border-radius: 2px;;
color: ${flavor.overlay1.hex};
}
#workspaces button:hover {
text-decoration: underline;
}
#workspaces button.focused {
font-weight: bold;
background-color: rgba(${flavor.surface2.raw}, 0.4);
color: ${flavor.text.hex};
}
#workspaces button.urgent {
color: ${flavor.yellow.hex};
}
#clock,
#network,
#pulseaudio,
#tray {
padding: 0px 6px;
color: inherit;
}
#pulseaudio:hover {
background-color: rgba(${flavor.surface2.raw}, 0.4);
}
'';
};
programs.ghostty =
let
darkFlavor =
if cfg.flavor == "latte" then
"mocha"
else
cfg.flavor;
in
{
settings = {
theme = "light:catppuccin-latte-corrected,dark:catppuccin-${darkFlavor}";
};
themes.catppuccin-latte-corrected = {
palette = [
"0=${json.latte.crust.hex}"
"1=${json.latte.red.hex}"
"2=${json.latte.green.hex}"
"3=${json.latte.yellow.hex}"
"4=${json.latte.blue.hex}"
"5=${json.latte.pink.hex}"
"6=${json.latte.teal.hex}"
"7=${json.latte.subtext0.hex}"
"8=${json.latte.surface2.hex}"
"9=#de293e"
"10=#49af3d"
"11=#eea02d"
"12=#456eff"
"13=#fe85d8"
"14=#2d9fa8"
"15=${json.latte.text.hex}"
];
background = stripSharp json.latte.base.hex;
foreground = stripSharp json.latte.text.hex;
cursor-color = stripSharp json.latte.rosewater.hex;
selection-background = stripSharp json.latte.surface2.hex;
selection-foreground = stripSharp json.latte.text.hex;
};
};
};
}