me like nix
1{ inputs, ... }:
2
3{
4 flake.modules.nixos.desktop =
5 { pkgs, lib, ... }:
6 {
7 programs.niri.enable = true;
8
9 programs.regreet = {
10 enable = true;
11 cageArgs = [
12 "-s"
13 "-d"
14 ];
15 settings.GTK.application_prefer_dark_theme = true;
16 theme = {
17 package = pkgs.catppuccin-gtk.override {
18 variant = "frappe";
19 accents = [ "lavender" ];
20 size = "standard";
21 };
22 name = "catppuccin-frappe-lavender-standard";
23 };
24 iconTheme = {
25 package = pkgs.catppuccin-papirus-folders.override {
26 flavor = "frappe";
27 accent = "lavender";
28 };
29 name = "Papirus-Dark";
30 };
31 cursorTheme = {
32 package = pkgs.catppuccin-cursors.frappeDark;
33 name = "catppuccin-frappe-dark-cursors";
34 };
35 };
36
37 # Scale regreet's greeter for HiDPI displays
38 services.greetd.settings.default_session.command =
39 lib.mkForce "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} -s -d -- env GDK_SCALE=2 ${lib.getExe pkgs.regreet}";
40
41 # ZSA Keyboard udev rules for Oryx web flashing and live training
42 services.udev.extraRules = ''
43 # Rules for Oryx web flashing and live training
44 KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", MODE="0664", GROUP="plugdev"
45 KERNEL=="hidraw*", ATTRS{idVendor}=="3297", MODE="0664", GROUP="plugdev"
46
47 # Legacy rules for live training over webusb (Not needed for firmware v21+)
48 # Rule for all ZSA keyboards
49 SUBSYSTEM=="usb", ATTR{idVendor}=="3297", GROUP="plugdev"
50 # Rule for the Moonlander
51 SUBSYSTEM=="usb", ATTR{idVendor}=="3297", ATTR{idProduct}=="1969", GROUP="plugdev"
52 # Rule for the Ergodox EZ
53 SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="1307", GROUP="plugdev"
54 # Rule for the Planck EZ
55 SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="6060", GROUP="plugdev"
56
57 # Wally Flashing rules for the Ergodox EZ
58 ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
59 ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
60 SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
61 KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
62
63 # Keymapp / Wally Flashing rules for the Moonlander and Planck EZ
64 SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666", SYMLINK+="stm32_dfu"
65 # Keymapp Flashing rules for the Voyager
66 SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", MODE:="0666", SYMLINK+="ignition_dfu"
67 # USB serial device access via Chrome/Chromium
68 KERNEL=="ttyUSB[0-9]*", MODE:="0666", GROUP="dialout"
69 KERNEL=="ttyACM[0-9]*", MODE:="0666", GROUP="dialout"
70 '';
71 };
72
73 flake.modules.homeManager.desktop =
74 { pkgs, config, ... }:
75 let
76 wallpapers = import ./_data/wallpapers.nix;
77 downloads = builtins.concatStringsSep "\n" (
78 map (wp: ''
79 if [ ! -f "$DIR/${wp.filename}" ]; then
80 echo "Downloading ${wp.filename}..."
81 ${pkgs.curl}/bin/curl -fsSL -o "$DIR/${wp.filename}" ${
82 builtins.replaceStrings [ "\"" ] [ "\\\"" ] wp.url
83 } || echo "WARNING: Failed to download ${wp.filename}, skipping"
84 fi
85 '') wallpapers
86 );
87 in
88 {
89 home.packages = with pkgs; [
90 inputs.fsel.packages.${pkgs.stdenv.hostPlatform.system}.default
91 bemoji
92 (import ../packages/cclip.nix { inherit pkgs; })
93 xwayland-satellite
94 ];
95
96 programs.niri = {
97 enable = true;
98 settings = {
99 window-rules = [
100 {
101 geometry-corner-radius = {
102 top-left = 5.0;
103 top-right = 5.0;
104 bottom-left = 5.0;
105 bottom-right = 5.0;
106 };
107 clip-to-geometry = true;
108 draw-border-with-background = false;
109 }
110 {
111 matches = [ { app-id = "^steam_app_"; } ];
112 border.enable = false;
113 open-fullscreen = true;
114 }
115 {
116 matches = [ { app-id = "^fsel$"; } ];
117 open-floating = true;
118 default-column-width.fixed = 800;
119 default-window-height.fixed = 500;
120 }
121 ];
122 debug = {
123 honor-xdg-activation-with-invalid-serial = { };
124 };
125 layout = {
126 focus-ring = {
127 width = 2;
128 };
129 struts = {
130 top = -6;
131 bottom = -6;
132 left = 0;
133 right = 0;
134 };
135 gaps = 8;
136 };
137 gestures = {
138 hot-corners = {
139 enable = false;
140 };
141 };
142 binds = {
143 "Mod+d".action.spawn = [
144 "alacritty"
145 "--class"
146 "fsel"
147 "-e"
148 "fsel"
149 "--detach"
150 ];
151 "Mod+c".action.spawn = [
152 "alacritty"
153 "--class"
154 "fsel"
155 "-e"
156 "fsel"
157 "--cclip"
158 ];
159 "Mod+e".action.spawn = "bemoji";
160 "Mod+n".action.spawn = [
161 "noctalia"
162 "msg"
163 "panel-toggle"
164 "notifications"
165 ];
166 "Mod+a".action.spawn = "alacritty";
167 "Mod+h".action = {
168 focus-column-left = { };
169 };
170 "Mod+j".action = {
171 focus-workspace-down = { };
172 };
173 "Mod+k".action = {
174 focus-workspace-up = { };
175 };
176 "Mod+l".action = {
177 focus-column-right = { };
178 };
179 "Mod+Shift+h".action = {
180 move-column-left = { };
181 };
182 "Mod+Shift+j".action = {
183 move-window-down-or-to-workspace-down = { };
184 };
185 "Mod+Shift+k".action = {
186 move-window-up-or-to-workspace-up = { };
187 };
188 "Mod+Shift+l".action = {
189 move-column-right = { };
190 };
191 "Mod+Down".action = {
192 move-workspace-down = { };
193 };
194 "Mod+Up".action = {
195 move-workspace-up = { };
196 };
197 "Mod+p".action = {
198 show-hotkey-overlay = { };
199 };
200 "Mod+o".action = {
201 toggle-overview = { };
202 };
203 "Mod+q".action = {
204 close-window = { };
205 };
206 "Mod+f".action = {
207 toggle-window-floating = { };
208 };
209 "Mod+Shift+f".action = {
210 switch-focus-between-floating-and-tiling = { };
211 };
212 "Mod+m".action = {
213 fullscreen-window = { };
214 };
215 "Mod+s".action = {
216 screenshot = {
217 show-pointer = true;
218 };
219 };
220 "Mod+1".action = {
221 set-column-width = "100%";
222 };
223 "Mod+2".action = {
224 set-column-width = "50%";
225 };
226 "Mod+Minus".action = {
227 set-column-width = "-10%";
228 };
229 "Mod+Equal".action = {
230 set-column-width = "+10%";
231 };
232 "Mod+Shift+q".action = {
233 quit = { };
234 };
235 "Mod+Shift+r".action.spawn = [
236 "systemctl"
237 "--user"
238 "restart"
239 "noctalia.service"
240 ];
241 "XF86AudioPlay".action.spawn = [
242 "noctalia"
243 "msg"
244 "media"
245 "toggle"
246 ];
247 "XF86AudioStop".action.spawn = [
248 "noctalia"
249 "msg"
250 "media"
251 "stop"
252 ];
253 "XF86AudioNext".action.spawn = [
254 "noctalia"
255 "msg"
256 "media"
257 "next"
258 ];
259 "XF86AudioPrev".action.spawn = [
260 "noctalia"
261 "msg"
262 "media"
263 "previous"
264 ];
265 "XF86AudioMute".action.spawn = [
266 "noctalia"
267 "msg"
268 "volume-mute"
269 ];
270 "XF86AudioLowerVolume".action.spawn = [
271 "noctalia"
272 "msg"
273 "volume-down"
274 "5%"
275 ];
276 "XF86AudioRaiseVolume".action.spawn = [
277 "noctalia"
278 "msg"
279 "volume-up"
280 "5%"
281 ];
282 "XF86MonBrightnessDown".action.spawn = [
283 "noctalia"
284 "msg"
285 "brightness-down"
286 "5%"
287 ];
288 "XF86MonBrightnessUp".action.spawn = [
289 "noctalia"
290 "msg"
291 "brightness-up"
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 # Wallpaper downloads
380 home.activation.downloadWallpapers = config.lib.dag.entryAfter [ "writeBoundary" ] ''
381 DIR="${config.home.homeDirectory}/Pictures/Wallpapers"
382 mkdir -p "$DIR"
383 ${downloads}
384 '';
385
386 services.udiskie = {
387 enable = true;
388 tray = "never";
389 automount = true;
390 };
391
392 home.pointerCursor = {
393 name = "Adwaita";
394 package = pkgs.adwaita-icon-theme;
395 size = 16;
396 x11.enable = true;
397 gtk.enable = true;
398 };
399 };
400}