summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/default.nix')
-rw-r--r--accounts/gkleen@sif/default.nix374
1 files changed, 36 insertions, 338 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 83dcf989..58cfb425 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -80,7 +80,7 @@ let
80 ]; 80 ];
81 }; 81 };
82 82
83 lockCommand = "${config.systemd.package}/bin/systemctl --user start gtklock.service"; 83 lockCommand = "${lib.getExe' config.systemd.package "systemctl"} --user start gtklock.service";
84in { 84in {
85 imports = with flake.nixosModules.userProfiles.${userName}; [ 85 imports = with flake.nixosModules.userProfiles.${userName}; [
86 mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) 86 mpv yt-dlp (args: import ./xcompose.nix (inputs // args))
@@ -92,6 +92,7 @@ in {
92 home-manager.users.${userName} = { 92 home-manager.users.${userName} = {
93 imports = [ 93 imports = [
94 ./libvirt 94 ./libvirt
95 ./niri
95 flakeInputs.nix-index-database.hmModules.nix-index 96 flakeInputs.nix-index-database.hmModules.nix-index
96 flakeInputs.impermanence.nixosModules.home-manager.impermanence 97 flakeInputs.impermanence.nixosModules.home-manager.impermanence
97 ]; 98 ];
@@ -184,7 +185,12 @@ in {
184 }; 185 };
185 }; 186 };
186 187
187 zathura.enable = true; 188 zathura = {
189 enable = true;
190 options = {
191 scroll-page-aware = true;
192 };
193 };
188 imv.enable = true; 194 imv.enable = true;
189 195
190 mpv.config = { 196 mpv.config = {
@@ -250,287 +256,6 @@ in {
250 "kitty_mod+m" = "detach_window ask"; 256 "kitty_mod+m" = "detach_window ask";
251 }; 257 };
252 }; 258 };
253 waybar = {
254 enable = true;
255 systemd = {
256 enable = true;
257 target = "hyprland-session.target";
258 };
259 settings = let
260 windowRewrites = {
261 "(.*) — Mozilla Firefox" = "$1";
262 "(.*) - Mozilla Thunderbird" = "$1";
263 "(.*) - mpv" = "$1";
264 };
265 iconSize = 11;
266 in [
267 {
268 layer = "top";
269 position = "top";
270 height = 14;
271 output = [ "eDP-1" "DP-2" "DP-3" ];
272 modules-left = [ "hyprland/workspaces" ];
273 modules-center = [ "hyprland/window" ];
274 modules-right = [ # "custom/worktime" "custom/worktime-today"
275 "custom/weather" "custom/keymap" "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "clock" ];
276
277 "custom/weather" = {
278 format = "{}";
279 tooltip = true;
280 interval = 3600;
281 exec = "${lib.getExe pkgs.wttrbar} --hide-conditions --nerd --custom-indicator \"<span font=\\\"Symbols Nerd Font Mono\\\" size=\\\"120%\\\">{ICON}</span> {FeelsLikeC}°\"";
282 return-type = "json";
283 };
284 "custom/keymap" = {
285 format = "{}";
286 tooltip = true;
287 return-type = "json";
288 exec = pkgs.writers.writePython3 "keymap" {} ''
289 import os
290 import socket
291 import re
292 import subprocess
293 import json
294
295
296 def output(keymap):
297 short = keymap
298 if keymap == "English (programmer Dvorak)":
299 short = "dvp"
300 elif keymap == "English (US)":
301 short = "<span color=\"#ffffff\">us</span>"
302 print(json.dumps({'text': short, 'tooltip': keymap}, separators=(',', ':')), flush=True) # noqa: E501
303
304
305 r = subprocess.run(["hyprctl", "devices", "-j"], check=True, stdout=subprocess.PIPE, text=True) # noqa: E501
306 for keyboard in json.loads(r.stdout)['keyboards']:
307 if keyboard['name'] != "at-translated-set-2-keyboard":
308 continue
309 output(keyboard['active_keymap'])
310
311 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
312 sock.connect(os.environ["XDG_RUNTIME_DIR"] + "/hypr/" + os.environ["HYPRLAND_INSTANCE_SIGNATURE"] + "/.socket2.sock") # noqa: E501
313 expected = re.compile(r'^activelayout>>at-translated-set-2-keyboard,(?P<keymap>.+)$') # noqa: E501
314 for line in sock.makefile(buffering=1, encoding='utf-8'):
315 if match := expected.match(line):
316 output(match.group("keymap"))
317 '';
318 on-click = "hyprctl switchxkblayout at-translated-set-2-keyboard next";
319 };
320 "custom/worktime" = {
321 interval = 60;
322 exec = getExe pkgs.worktime;
323 tooltip = false;
324 };
325 "custom/worktime-today" = {
326 interval = 60;
327 exec = "${getExe pkgs.worktime} today";
328 tooltip = false;
329 };
330 "hyprland/workspaces" = {
331 all-outputs = true;
332 };
333 "hyprland/window" = {
334 separate-outputs = true;
335 icon = true;
336 icon-size = 14;
337 rewrite = windowRewrites;
338 };
339 clock = {
340 interval = 1;
341 # timezone = "Europe/Berlin";
342 format = "W{:%V-%u %F %H:%M:%S%Ez}";
343 tooltip-format = "<tt><small>{calendar}</small></tt>";
344 calendar = {
345 mode = "year";
346 mode-mon-col = 3;
347 weeks-pos = "left";
348 on-scroll = 1;
349 format = {
350 months = "<span color='#ffead3'><b>{}</b></span>";
351 days = "{}";
352 weeks = "<span color='#99ffdd'><b>{}</b></span>";
353 weekdays = "<span color='#ffcc66'><b>{}</b></span>";
354 today = "<span color='#ff6699'><b>{}</b></span>";
355 };
356 };
357 };
358 battery = {
359 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
360 icon-size = iconSize - 2;
361 states = { warning = 30; critical = 15; };
362 format-icons = ["&#xf008e;" "&#xf007a;" "&#xf007b;" "&#xf007c;" "&#xf007d;" "&#xf007e;" "&#xf007f;" "&#xf0080;" "&#xf0081;" "&#xf0082;" "&#xf0079;" ];
363 format-charging = "&#xf0084;";
364 format-plugged = "&#xf06a5;";
365 tooltip-format = "{capacity}% {timeTo}";
366 interval = 20;
367 };
368 tray = {
369 icon-size = 16;
370 # show-passive-items = true;
371 spacing = 1;
372 };
373 privacy = {
374 icon-spacing = 7;
375 icon-size = iconSize;
376 modules = [
377 { type = "screenshare"; }
378 { type = "audio-in"; }
379 ];
380 };
381 idle_inhibitor = {
382 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
383 icon-size = iconSize;
384 format-icons = { activated = "&#xf0208;"; deactivated = "&#xf0209;"; };
385 timeout = 120;
386 };
387 backlight = {
388 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
389 icon-size = iconSize;
390 tooltip-format = "{percent}%";
391 format-icons = ["&#xf00da;" "&#xf00db;" "&#xf00dc;" "&#xf00dd;" "&#xf00de;" "&#xf00df;" "&#xf00e0;"];
392 on-scroll-up = "lightctl -d -e4 -n1 up";
393 on-scroll-down = "lightctl -d -e4 -n1 down";
394 };
395 wireplumber = {
396 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
397 icon-size = iconSize;
398 tooltip-format = "{volume}% {node_name}";
399 format-icons = ["&#xf057f;" "&#xf0580;" "&#xf057e;"];
400 format-muted = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">&#xf075f;</span>";
401 # ignored-sinks = ["Easy Effects Sink"];
402 on-scroll-up = "volumectl -d -u up";
403 on-scroll-down = "volumectl -d -u down";
404 on-click = "volumectl -d toggle-mute";
405 };
406 }
407 {
408 layer = "top";
409 position = "top";
410 height = 14;
411 output = [ "!eDP-1" "!DP-2" "!DP-3" ];
412 modules-left = [ "hyprland/workspaces" ];
413 modules-center = [ "hyprland/window" ];
414 modules-right = [ "clock" ];
415
416 "hyprland/workspaces" = {
417 all-outputs = false;
418 };
419 "hyprland/window" = {
420 separate-outputs = true;
421 icon = true;
422 icon-size = 14;
423 rewrite = windowRewrites;
424 };
425 clock = {
426 interval = 1;
427 # timezone = "Europe/Berlin";
428 format = "{:%H:%M}";
429 tooltip-format = "W{:%V-%u %F %H:%M:%S%Ez}";
430 };
431 }
432 ];
433 style = ''
434 @define-color white #ffffff;
435 @define-color grey #555555;
436 @define-color blue #1a8fff;
437 @define-color green #23fd00;
438 @define-color orange #f28a21;
439 @define-color red #f2201f;
440
441 * {
442 border: none;
443 font-family: "Fira Sans Nerd Font";
444 font-size: 10pt;
445 min-height: 0;
446 }
447
448 window#waybar {
449 background-color: rgba(0, 0, 0, 0.66);
450 color: @white;
451 }
452
453 .modules-left {
454 margin-left: 9px;
455 }
456 .modules-right {
457 margin-right: 9px;
458 }
459
460 .module {
461 margin: 0 5px;
462 }
463
464 #workspaces button {
465 color: @grey;
466 }
467 #workspaces button.hosting-monitor {
468 color: @white;
469 }
470 #workspaces button.visible {
471 color: @blue;
472 }
473 #workspaces button.active {
474 color: @green;
475 }
476 #workspaces button.urgent {
477 color: @red;
478 }
479
480 #custom-weather, #custom-keymap, #custom-worktime, #custom-worktime-today {
481 color: @grey;
482 margin: 0 5px;
483 }
484 #custom-weather, #custom-worktime-today {
485 margin-right: 3px;
486 }
487 #custom-keymap, #custom-weather {
488 margin-left: 3px;
489 }
490
491 #tray {
492 margin: 0;
493 }
494 #battery, #idle_inhibitor, #backlight, #wireplumber {
495 color: @grey;
496 margin: 0 5px 0 2px;
497 }
498 #idle_inhibitor {
499 margin-right: 2px;
500 margin-left: 3px;
501 }
502 #battery {
503 margin-right: 3px;
504 }
505 #battery.discharging {
506 color: @white;
507 }
508 #battery.warning {
509 color: @orange;
510 }
511 #battery.critical {
512 color: @red;
513 }
514 #battery.charging {
515 color: @white;
516 }
517 #idle_inhibitor.activated {
518 color: @white;
519 }
520
521 #idle_inhibitor {
522 padding-top: 1px;
523 }
524
525 #privacy {
526 color: @red;
527 margin: -1px 2px 0px 5px;
528 }
529 #clock {
530 /* margin-right: 5px; */
531 }
532 '';
533 };
534 wpaperd = { 259 wpaperd = {
535 enable = true; 260 enable = true;
536 settings.default = { 261 settings.default = {
@@ -543,7 +268,7 @@ in {
543 enable = true; 268 enable = true;
544 settings = { 269 settings = {
545 main = { 270 main = {
546 terminal = lib.getExe pkgs.kitty; 271 terminal = lib.getExe cfg.programs.kitty.package;
547 layer = "overlay"; 272 layer = "overlay";
548 icon-theme = "Paper"; 273 icon-theme = "Paper";
549 font = "Fira Sans"; 274 font = "Fira Sans";
@@ -565,14 +290,6 @@ in {
565 }; 290 };
566 291
567 services = { 292 services = {
568 dunst = {
569 settings = import ./dunst-settings.nix inputs;
570 iconTheme = {
571 package = pkgs.paper-icon-theme;
572 name = "Paper";
573 };
574 enable = true;
575 };
576 emacs = { 293 emacs = {
577 enable = true; 294 enable = true;
578 socketActivation.enable = true; 295 socketActivation.enable = true;
@@ -601,8 +318,11 @@ in {
601 device_mounted = []; 318 device_mounted = [];
602 }; 319 };
603 device_config = [ 320 device_config = [
604 { mount_path = "/run/etc-metadata"; ignore = true; } 321 { loop_file = "/nix/store/*-etc-metadata.erofs"; is_mounted = false; ignore = true; }
322 { mount_path = "/run/nixos-etc-metadata"; ignore = true; }
323 { mount_path = "/run/nixos-etc-metadata.*"; ignore = true; }
605 ]; 324 ];
325 icon_names.media = ["drive-removable-media-symbolic"];
606 }; 326 };
607 }; 327 };
608 network-manager-applet.enable = true; 328 network-manager-applet.enable = true;
@@ -639,31 +359,17 @@ in {
639 enable = true; 359 enable = true;
640 events = [ 360 events = [
641 { event = "before-sleep"; command = lockCommand; } 361 { event = "before-sleep"; command = lockCommand; }
642 { event = "after-resume"; command = "${cfg.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on"; }
643 { event = "lock"; command = lockCommand; } 362 { event = "lock"; command = lockCommand; }
644 ]; 363 ];
645 timeouts = [ 364 timeouts = [
646 { timeout = 300;
647 command = "${cfg.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off";
648 }
649 { timeout = 330; command = lockCommand; } 365 { timeout = 330; command = lockCommand; }
650 ]; 366 ];
651 extraArgs = [ 367 extraArgs = [
368 "-w"
652 "idlehint" "30" 369 "idlehint" "30"
653 ]; 370 ];
654 }; 371 };
655 poweralertd.enable = true; 372 poweralertd.enable = true;
656 avizo = {
657 enable = true;
658 settings.default = {
659 time = "1.0";
660 background = "rgba(0, 0, 0, 0.8)";
661 border-color = "rgba(0, 0, 0, 1)";
662 bar-fg-color = "rgba(160, 160, 160, 1)";
663 bar-bg-color = "rgba(32, 32, 32, 0.96)";
664 # y-offset = "0.25";
665 };
666 };
667 }; 373 };
668 374
669 home.pointerCursor = { 375 home.pointerCursor = {
@@ -704,16 +410,18 @@ in {
704 fira fira-code pwvucontrol wrappedKeepassxc wl-clipboard-rs 410 fira fira-code pwvucontrol wrappedKeepassxc wl-clipboard-rs
705 mumble pulseaudio-ctl pamixer libnotify screen-message 411 mumble pulseaudio-ctl pamixer libnotify screen-message
706 wrappedYTMDesktop libsForQt5.qt5ct playerctl evince 412 wrappedYTMDesktop libsForQt5.qt5ct playerctl evince
707 thunderbird zoom-us steam steam-run wireshark virt-manager 413 thunderbird zoom-us xdg-desktop-portal steam steam-run
708 rclone cached-nix-shell worktime fira-code-symbols 414 wireshark virt-manager rclone cached-nix-shell worktime
709 libreoffice xournalpp google-chrome nixos-shell virt-viewer 415 fira-code-symbols libreoffice xournalpp google-chrome
710 freerdp gnome-icon-theme paper-icon-theme sshpassSecret 416 nixos-shell virt-viewer freerdp gnome-icon-theme
711 weechat element-desktop matrix-synapse-tools.synadm 417 paper-icon-theme sshpassSecret weechat element-desktop
418 matrix-synapse-tools.synadm
712 flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs 419 flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs
713 sieve-connect gimp inkscape udiskie glab nitrokey-app 420 sieve-connect gimp inkscape udiskie glab nitrokey-app
714 pynitrokey gtklock wlrctl remmina openscad spice-record 421 pynitrokey gtklock wlrctl remmina openscad spice-record
715 libguestfs-with-appliance nerd-fonts.fira-mono 422 libguestfs-with-appliance nerd-fonts.fira-mono
716 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts 423 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts
424 swtpm
717 ]; 425 ];
718 426
719 file = { 427 file = {
@@ -748,13 +456,6 @@ in {
748 }; 456 };
749 457
750 xdg.configFile = { 458 xdg.configFile = {
751 "dunst/dunstrc.d" = {
752 source = ./dunstrc.d;
753 recursive = true;
754 onChange = ''
755 ${pkgs.systemd}/bin/systemctl --user try-restart dunst
756 '';
757 };
758 "wireplumber" = { 459 "wireplumber" = {
759 source = ./wireplumber; 460 source = ./wireplumber;
760 recursive = true; 461 recursive = true;
@@ -786,6 +487,18 @@ in {
786 }; 487 };
787 }; 488 };
788 "emacs/init.el".source = ./emacs.el; 489 "emacs/init.el".source = ./emacs.el;
490 "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = ''
491 [Unit]
492 After=graphical-session.target
493 '';
494 "systemd/user/home-manager.service.d/before-graphical-session.conf".text = ''
495 [Unit]
496 Before=graphical-session-pre.target
497 '';
498 "pdfpc/pdfpcrc".text = ''
499 mouse 8 prev
500 mouse 9 next
501 '';
789 }; 502 };
790 503
791 xdg.dataFile = { 504 xdg.dataFile = {
@@ -903,7 +616,6 @@ in {
903 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \ 616 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \
904 --property 'Environment=DSCP=46' \ 617 --property 'Environment=DSCP=46' \
905 -- ${pkgs.dscp}/bin/dscp ${pkgs.google-chrome}/bin/google-chrome-stable \ 618 -- ${pkgs.dscp}/bin/dscp ${pkgs.google-chrome}/bin/google-chrome-stable \
906 --force-device-scale-factor=1.5 \
907 --class=Rainbow \ 619 --class=Rainbow \
908 --kiosk "https://web.openrainbow.com" \ 620 --kiosk "https://web.openrainbow.com" \
909 --user-data-dir=''${HOME}/.config/google-chrome-rainbow 621 --user-data-dir=''${HOME}/.config/google-chrome-rainbow
@@ -912,6 +624,9 @@ in {
912 url = "https://web.openrainbow.com/rb/2.139.17/assets/skins/rainbow/images/homepage/logo__rainbow.svg"; 624 url = "https://web.openrainbow.com/rb/2.139.17/assets/skins/rainbow/images/homepage/logo__rainbow.svg";
913 hash = "sha256-5fmo8rDqVDpzkGaPjk4Y+SsSZpAsY7VUQSFW6WdHwuU="; 625 hash = "sha256-5fmo8rDqVDpzkGaPjk4Y+SsSZpAsY7VUQSFW6WdHwuU=";
914 }; 626 };
627 settings = {
628 StartupWMClass = "Rainbow";
629 };
915 }; 630 };
916 }; 631 };
917 632
@@ -927,23 +642,6 @@ in {
927 color-scheme = "prefer-dark"; 642 color-scheme = "prefer-dark";
928 }; 643 };
929 }; 644 };
930
931 wayland.windowManager.hyprland = {
932 enable = true;
933 settings = import ./hyprland.nix inputs;
934 };
935
936 xdg.portal = {
937 enable = true;
938 xdgOpenUsePortal = true;
939 config = {
940 common.default = [ "gtk" ];
941 hyprland.default = [ "gtk" "kde" "hyprland" ];
942 };
943 extraPortals = with pkgs; [
944 xdg-desktop-portal-kde xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-desktop-portal-hyprland
945 ];
946 };
947 }; 645 };
948 }; 646 };
949} 647}