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