me like nix
1{ inputs, ... }:
2
3{
4 flake.modules.nixos.desktop =
5 { pkgs, lib, ... }:
6 {
7 programs.niri.enable = true;
8
9 catppuccin = {
10 enable = true;
11 autoEnable = true;
12 flavor = "frappe";
13 };
14
15 programs.regreet = {
16 enable = true;
17 cageArgs = [
18 "-s"
19 "-d"
20 ];
21 settings.GTK.application_prefer_dark_theme = true;
22 theme = {
23 package = pkgs.catppuccin-gtk.override {
24 variant = "frappe";
25 accents = [ "lavender" ];
26 size = "standard";
27 };
28 name = "catppuccin-frappe-lavender-standard";
29 };
30 iconTheme = {
31 package = pkgs.catppuccin-papirus-folders.override {
32 flavor = "frappe";
33 accent = "lavender";
34 };
35 name = "Papirus-Dark";
36 };
37 cursorTheme = {
38 package = pkgs.catppuccin-cursors.frappeDark;
39 name = "catppuccin-frappe-dark-cursors";
40 };
41 };
42
43 # Scale regreet's greeter for HiDPI displays
44 services.greetd.settings.default_session.command = lib.mkForce
45 "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} -s -d -- env GDK_SCALE=2 ${lib.getExe pkgs.regreet}";
46
47 # ZSA Keyboard udev rules for Oryx web flashing and live training
48 services.udev.extraRules = ''
49 # Rules for Oryx web flashing and live training
50 KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", MODE="0664", GROUP="plugdev"
51 KERNEL=="hidraw*", ATTRS{idVendor}=="3297", MODE="0664", GROUP="plugdev"
52
53 # Legacy rules for live training over webusb (Not needed for firmware v21+)
54 # Rule for all ZSA keyboards
55 SUBSYSTEM=="usb", ATTR{idVendor}=="3297", GROUP="plugdev"
56 # Rule for the Moonlander
57 SUBSYSTEM=="usb", ATTR{idVendor}=="3297", ATTR{idProduct}=="1969", GROUP="plugdev"
58 # Rule for the Ergodox EZ
59 SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="1307", GROUP="plugdev"
60 # Rule for the Planck EZ
61 SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="6060", GROUP="plugdev"
62
63 # Wally Flashing rules for the Ergodox EZ
64 ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
65 ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
66 SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
67 KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
68
69 # Keymapp / Wally Flashing rules for the Moonlander and Planck EZ
70 SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666", SYMLINK+="stm32_dfu"
71 # Keymapp Flashing rules for the Voyager
72 SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", MODE:="0666", SYMLINK+="ignition_dfu"
73 # USB serial device access via Chrome/Chromium
74 KERNEL=="ttyUSB[0-9]*", MODE:="0666", GROUP="dialout"
75 KERNEL=="ttyACM[0-9]*", MODE:="0666", GROUP="dialout"
76 '';
77 };
78
79 flake.modules.homeManager.desktop =
80 { pkgs, config, ... }:
81 let
82 wallpapers = import ./_data/wallpapers.nix;
83 downloads = builtins.concatStringsSep "\n" (
84 map (wp: ''
85 if [ ! -f "$DIR/${wp.filename}" ]; then
86 echo "Downloading ${wp.filename}..."
87 ${pkgs.curl}/bin/curl -fsSL -o "$DIR/${wp.filename}" ${
88 builtins.replaceStrings [ "\"" ] [ "\\\"" ] wp.url
89 } || echo "WARNING: Failed to download ${wp.filename}, skipping"
90 fi
91 '') wallpapers
92 );
93 in
94 {
95 home.packages = with pkgs; [
96 inputs.fsel.packages.${pkgs.stdenv.hostPlatform.system}.default
97 inputs.mako-tui.packages.${pkgs.stdenv.hostPlatform.system}.default
98 bemoji
99 networkmanager_dmenu
100 (import ../packages/cclip.nix { inherit pkgs; })
101 pavucontrol
102 playerctl
103 xwayland-satellite
104 ];
105
106 programs.niri = {
107 enable = true;
108 settings = {
109 window-rules = [
110 {
111 geometry-corner-radius = {
112 top-left = 5.0;
113 top-right = 5.0;
114 bottom-left = 5.0;
115 bottom-right = 5.0;
116 };
117 clip-to-geometry = true;
118 draw-border-with-background = false;
119 }
120 {
121 matches = [ { app-id = "^steam_app_"; } ];
122 border.enable = false;
123 open-fullscreen = true;
124 }
125 {
126 matches = [ { app-id = "^fsel$"; } ];
127 open-floating = true;
128 default-column-width.fixed = 800;
129 default-window-height.fixed = 500;
130 }
131 {
132 matches = [ { app-id = "^mako-tui$"; } ];
133 open-floating = true;
134 default-column-width.fixed = 800;
135 default-window-height.fixed = 500;
136 }
137 ];
138 debug = {
139 honor-xdg-activation-with-invalid-serial = { };
140 };
141 layout = {
142 focus-ring = {
143 width = 2;
144 active.color = "#8caaee";
145 inactive.color = "#414559";
146 };
147 struts = {
148 top = -6;
149 bottom = -6;
150 left = 0;
151 right = 0;
152 };
153 gaps = 8;
154 };
155 gestures = {
156 hot-corners = {
157 enable = false;
158 };
159 };
160 binds = {
161 "Mod+d".action.spawn = [
162 "alacritty"
163 "--class"
164 "fsel"
165 "-e"
166 "fsel"
167 "--detach"
168 ];
169 "Mod+c".action.spawn = [
170 "alacritty"
171 "--class"
172 "fsel"
173 "-e"
174 "fsel"
175 "--cclip"
176 ];
177 "Mod+e".action.spawn = "bemoji";
178 "Mod+n".action.spawn = [
179 "alacritty"
180 "--class"
181 "mako-tui"
182 "-e"
183 "mako-tui"
184 ];
185 "Mod+a".action.spawn = "alacritty";
186 "Mod+h".action = {
187 focus-column-left = { };
188 };
189 "Mod+j".action = {
190 focus-workspace-down = { };
191 };
192 "Mod+k".action = {
193 focus-workspace-up = { };
194 };
195 "Mod+l".action = {
196 focus-column-right = { };
197 };
198 "Mod+Shift+h".action = {
199 move-column-left = { };
200 };
201 "Mod+Shift+j".action = {
202 move-window-down-or-to-workspace-down = { };
203 };
204 "Mod+Shift+k".action = {
205 move-window-up-or-to-workspace-up = { };
206 };
207 "Mod+Shift+l".action = {
208 move-column-right = { };
209 };
210 "Mod+Down".action = {
211 move-workspace-down = { };
212 };
213 "Mod+Up".action = {
214 move-workspace-up = { };
215 };
216 "Mod+p".action = {
217 show-hotkey-overlay = { };
218 };
219 "Mod+o".action = {
220 toggle-overview = { };
221 };
222 "Mod+q".action = {
223 close-window = { };
224 };
225 "Mod+f".action = {
226 toggle-window-floating = { };
227 };
228 "Mod+Shift+f".action = {
229 switch-focus-between-floating-and-tiling = { };
230 };
231 "Mod+m".action = {
232 fullscreen-window = { };
233 };
234 "Mod+s".action = {
235 screenshot = {
236 show-pointer = true;
237 };
238 };
239 "Mod+1".action = {
240 set-column-width = "100%";
241 };
242 "Mod+2".action = {
243 set-column-width = "50%";
244 };
245 "Mod+Minus".action = {
246 set-column-width = "-10%";
247 };
248 "Mod+Equal".action = {
249 set-column-width = "+10%";
250 };
251 "Mod+Shift+q".action = {
252 quit = { };
253 };
254 "Mod+Shift+r".action.spawn = [
255 "systemctl"
256 "--user"
257 "restart"
258 "noctalia.service"
259 ];
260 "XF86AudioPlay".action.spawn = [
261 "playerctl"
262 "play-pause"
263 ];
264 "XF86AudioStop".action.spawn = [
265 "playerctl"
266 "stop"
267 ];
268 "XF86AudioNext".action.spawn = [
269 "playerctl"
270 "next"
271 ];
272 "XF86AudioPrev".action.spawn = [
273 "playerctl"
274 "previous"
275 ];
276 "XF86MonBrightnessDown".action.spawn = [
277 "brightnessctl"
278 "set"
279 "5%-"
280 ];
281 "XF86MonBrightnessUp".action.spawn = [
282 "brightnessctl"
283 "set"
284 "+5%"
285 ];
286 };
287 outputs = {
288 "DP-5" = {
289 scale = 2.0;
290 mode = {
291 width = 5120;
292 height = 2160;
293 refresh = 120.0;
294 };
295 position = {
296 x = 0;
297 y = 0;
298 };
299 };
300 "DP-1" = {
301 scale = 2.0;
302 mode = {
303 width = 5120;
304 height = 2160;
305 refresh = 120.0;
306 };
307 position = {
308 x = 0;
309 y = 0;
310 };
311 };
312 "DP-2" = {
313 scale = 1.0;
314 mode = {
315 width = 5120;
316 height = 2160;
317 refresh = 120.0;
318 };
319 position = {
320 x = 0;
321 y = 0;
322 };
323 };
324 "DP-6" = {
325 scale = 2.0;
326 mode = {
327 width = 5120;
328 height = 2160;
329 refresh = 120.0;
330 };
331 position = {
332 x = 0;
333 y = 0;
334 };
335 };
336 "DP-7" = {
337 scale = 2.0;
338 mode = {
339 width = 5120;
340 height = 2160;
341 refresh = 120.0;
342 };
343 position = {
344 x = 0;
345 y = 0;
346 };
347 };
348 "eDP-1" = {
349 scale = 1.5;
350 mode = {
351 width = 2560;
352 height = 1600;
353 refresh = 165.0;
354 };
355 position = {
356 x = 0;
357 y = 1080;
358 };
359 };
360 };
361 spawn-at-startup = [
362 { command = [ "xwayland-satellite" ]; }
363 { command = [ "cclipd" ]; }
364 ];
365 environment = {
366 DISPLAY = ":0";
367 };
368 };
369 };
370
371 catppuccin = {
372 enable = true;
373 autoEnable = true;
374 flavor = "frappe";
375 alacritty.enable = false;
376 helix.enable = false;
377 };
378
379 programs.noctalia = {
380 enable = true;
381 systemd.enable = true;
382 settings = {
383 shell = {
384 launch_apps_as_systemd_services = true;
385 };
386 theme = {
387 mode = "dark";
388 source = "builtin";
389 builtin = "Catppuccin";
390 templates = {
391 enable_builtin_templates = true;
392 user = {
393 alacritty = {
394 input_path = "${inputs.noctalia}/assets/templates/alacritty/alacritty.toml";
395 output_path = "$XDG_CONFIG_HOME/alacritty/themes/noctalia.toml";
396 };
397 helix = {
398 input_path = "${inputs.noctalia}/assets/templates/helix/helix.toml";
399 output_path = "$XDG_CONFIG_HOME/helix/themes/noctalia.toml";
400 };
401 };
402 };
403 };
404 wallpaper = {
405 enabled = true;
406 directory = "${config.home.homeDirectory}/Pictures/Wallpapers";
407 automation = {
408 enabled = true;
409 interval_minutes = 15;
410 order = "random";
411 recursive = true;
412 };
413 };
414 };
415 };
416
417 # Wallpaper downloads
418 home.activation.downloadWallpapers =
419 config.lib.dag.entryAfter [ "writeBoundary" ] ''
420 DIR="${config.home.homeDirectory}/Pictures/Wallpapers"
421 mkdir -p "$DIR"
422 ${downloads}
423 '';
424
425 services.udiskie = {
426 enable = true;
427 tray = "never";
428 automount = true;
429 };
430
431 services.mako = {
432 enable = true;
433 settings = {
434 border-radius = 8;
435 border-size = 2;
436 padding = "12";
437 margin = "12";
438 font = "BerkeleyMono Nerd Font 11";
439 on-button-left = "invoke-default-action";
440 on-button-right = "dismiss";
441 };
442 };
443
444 dconf.settings = {
445 "org/gnome/desktop/interface" = {
446 color-scheme = "prefer-dark";
447 enable-hot-corners = false;
448 };
449 };
450
451 home.pointerCursor = {
452 name = "Adwaita";
453 package = pkgs.adwaita-icon-theme;
454 size = 16;
455 x11.enable = true;
456 gtk.enable = true;
457 };
458 };
459}