Flake for my NixOS devices

Switch to Niri

bwc9876.dev bf990e37 b33ea688

verified
+570 -458
+132 -26
flake.lock
··· 202 202 ] 203 203 }, 204 204 "locked": { 205 - "lastModified": 1762440070, 206 - "narHash": "sha256-xxdepIcb39UJ94+YydGP221rjnpkDZUlykKuF54PsqI=", 205 + "lastModified": 1762810396, 206 + "narHash": "sha256-dxFVgQPG+R72dkhXTtqUm7KpxElw3u6E+YlQ2WaDgt8=", 207 207 "owner": "hercules-ci", 208 208 "repo": "flake-parts", 209 - "rev": "26d05891e14c88eb4a5d5bee659c0db5afb609d8", 209 + "rev": "0bdadb1b265fb4143a75bd1ec7d8c915898a9923", 210 210 "type": "github" 211 211 }, 212 212 "original": { ··· 283 283 ] 284 284 }, 285 285 "locked": { 286 - "lastModified": 1762779084, 287 - "narHash": "sha256-BkC7JdC5vBFAkRoM4xPCDqlVsEvoqhdw8rFIEJETXpQ=", 286 + "lastModified": 1762844981, 287 + "narHash": "sha256-Sghy+Gi+zcUDFfdDJuKyPMtF/klSTeWjmJZoQH7SwzA=", 288 288 "owner": "nix-community", 289 289 "repo": "flakelight", 290 - "rev": "2772ecc2b9c6b7291d31a92cb85899418f29345e", 290 + "rev": "faf9643dce373b7a556c77af8f8b961a75a066a4", 291 291 "type": "github" 292 292 }, 293 293 "original": { ··· 410 410 ] 411 411 }, 412 412 "locked": { 413 - "lastModified": 1762721397, 414 - "narHash": "sha256-E428EuouA4nFTNlLuqlL4lVR78X+EbBIqDqsBFnB79w=", 413 + "lastModified": 1762787259, 414 + "narHash": "sha256-t2U/GLLXHa2+kJkwnFNRVc2fEJ/lUfyZXBE5iKzJdcs=", 415 415 "owner": "nix-community", 416 416 "repo": "home-manager", 417 - "rev": "b8645b18b0f5374127bbade6de7381ef0b3d5720", 417 + "rev": "37a3d97f2873e0f68711117c34d04b7c7ead8f4e", 418 418 "type": "github" 419 419 }, 420 420 "original": { ··· 475 475 "nixpkgs" 476 476 ], 477 477 "pre-commit-hooks-nix": "pre-commit-hooks-nix", 478 - "rust-overlay": [ 479 - "rust-overlay" 480 - ] 478 + "rust-overlay": "rust-overlay" 481 479 }, 482 480 "locked": { 483 481 "lastModified": 1762205063, ··· 493 491 "type": "github" 494 492 } 495 493 }, 494 + "niri": { 495 + "inputs": { 496 + "niri-stable": "niri-stable", 497 + "niri-unstable": "niri-unstable", 498 + "nixpkgs": [ 499 + "nixpkgs" 500 + ], 501 + "nixpkgs-stable": "nixpkgs-stable", 502 + "xwayland-satellite-stable": "xwayland-satellite-stable", 503 + "xwayland-satellite-unstable": "xwayland-satellite-unstable" 504 + }, 505 + "locked": { 506 + "lastModified": 1762857797, 507 + "narHash": "sha256-puoFJGlbL6khrQKozCO6Wgpq/IhA2Sfnz+ui/87lbQQ=", 508 + "owner": "sodiboo", 509 + "repo": "niri-flake", 510 + "rev": "2ff3443b4226f6721a43b75e76b6ca59caa34fec", 511 + "type": "github" 512 + }, 513 + "original": { 514 + "owner": "sodiboo", 515 + "repo": "niri-flake", 516 + "type": "github" 517 + } 518 + }, 519 + "niri-stable": { 520 + "flake": false, 521 + "locked": { 522 + "lastModified": 1756556321, 523 + "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", 524 + "owner": "YaLTeR", 525 + "repo": "niri", 526 + "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", 527 + "type": "github" 528 + }, 529 + "original": { 530 + "owner": "YaLTeR", 531 + "ref": "v25.08", 532 + "repo": "niri", 533 + "type": "github" 534 + } 535 + }, 536 + "niri-unstable": { 537 + "flake": false, 538 + "locked": { 539 + "lastModified": 1762854265, 540 + "narHash": "sha256-iykTzCzU8hI7b8LvAquYY4Asl2xj3AcLzWZv6rm8MGY=", 541 + "owner": "YaLTeR", 542 + "repo": "niri", 543 + "rev": "fb2f67c8a036f674e9101e15a7bb1cf61524ebde", 544 + "type": "github" 545 + }, 546 + "original": { 547 + "owner": "YaLTeR", 548 + "repo": "niri", 549 + "type": "github" 550 + } 551 + }, 496 552 "nix-index-db": { 497 553 "inputs": { 498 554 "nixpkgs": [ ··· 515 571 }, 516 572 "nixos-hardware": { 517 573 "locked": { 518 - "lastModified": 1762463231, 519 - "narHash": "sha256-hv1mG5j5PTbnWbtHHomzTus77pIxsc4x8VrMjc7+/YE=", 574 + "lastModified": 1762847253, 575 + "narHash": "sha256-BWWnUUT01lPwCWUvS0p6Px5UOBFeXJ8jR+ZdLX8IbrU=", 520 576 "owner": "NixOS", 521 577 "repo": "nixos-hardware", 522 - "rev": "52113c4f5cfd1e823001310e56d9c8d0699a6226", 578 + "rev": "899dc449bc6428b9ee6b3b8f771ca2b0ef945ab9", 523 579 "type": "github" 524 580 }, 525 581 "original": { ··· 544 600 "type": "github" 545 601 } 546 602 }, 603 + "nixpkgs-stable": { 604 + "locked": { 605 + "lastModified": 1762756533, 606 + "narHash": "sha256-HiRDeUOD1VLklHeOmaKDzf+8Hb7vSWPVFcWwaTrpm+U=", 607 + "owner": "NixOS", 608 + "repo": "nixpkgs", 609 + "rev": "c2448301fb856e351aab33e64c33a3fc8bcf637d", 610 + "type": "github" 611 + }, 612 + "original": { 613 + "owner": "NixOS", 614 + "ref": "nixos-25.05", 615 + "repo": "nixpkgs", 616 + "type": "github" 617 + } 618 + }, 547 619 "nixvim": { 548 620 "inputs": { 549 621 "flake-parts": "flake-parts_2", ··· 554 626 "systems": "systems_2" 555 627 }, 556 628 "locked": { 557 - "lastModified": 1762778675, 558 - "narHash": "sha256-dUlfSvX3vOTwQ90fH2Chx29TQF5/F0KNIG7Jnhut2GA=", 629 + "lastModified": 1762865386, 630 + "narHash": "sha256-2hkqfvY2wH+78M85X/ZApyZURnFc926b2mAHiyHcGDE=", 559 631 "owner": "nix-community", 560 632 "repo": "nixvim", 561 - "rev": "0f561db35c832ebabd3447f420662cb8753a2d8c", 633 + "rev": "9e556e752505263eef8c0d0f982e2ab9029cc512", 562 634 "type": "github" 563 635 }, 564 636 "original": { ··· 697 769 "hm": "hm", 698 770 "imperm": "imperm", 699 771 "lanzaboote": "lanzaboote", 772 + "niri": "niri", 700 773 "nix-index-db": "nix-index-db", 701 774 "nixos-hardware": "nixos-hardware", 702 775 "nixpkgs": "nixpkgs", 703 776 "nixvim": "nixvim", 704 777 "nu_plugin_dbus": "nu_plugin_dbus", 705 - "rust-overlay": "rust-overlay", 706 778 "spoon": "spoon", 707 779 "wayland-mpris-idle-inhibit": "wayland-mpris-idle-inhibit" 708 780 } ··· 744 816 "rust-overlay": { 745 817 "inputs": { 746 818 "nixpkgs": [ 819 + "lanzaboote", 747 820 "nixpkgs" 748 821 ] 749 822 }, 750 823 "locked": { 751 - "lastModified": 1762742448, 752 - "narHash": "sha256-XMxV0h13gg63s0sV6beihCIqdpcJhtbse6DHI743nvo=", 824 + "lastModified": 1761791894, 825 + "narHash": "sha256-myRIDh+PxaREz+z9LzbqBJF+SnTFJwkthKDX9zMyddY=", 753 826 "owner": "oxalica", 754 827 "repo": "rust-overlay", 755 - "rev": "7f3556887e3375dc26ff1601b57c93ee286f2c5e", 828 + "rev": "59c45eb69d9222a4362673141e00ff77842cd219", 756 829 "type": "github" 757 830 }, 758 831 "original": { ··· 779 852 ] 780 853 }, 781 854 "locked": { 782 - "lastModified": 1762377373, 783 - "narHash": "sha256-oc2sIniNQQwArQyASFCMtci2T88qtVgZEjgdVN3UzCY=", 855 + "lastModified": 1762836691, 856 + "narHash": "sha256-4g00XF3VcjC2WkX+DQHhsL6Sv7OHK3PzzGOjh2m1uPo=", 784 857 "ref": "refs/heads/main", 785 - "rev": "04dfe79667923fccb4cf2a361af4a99f7af10f48", 786 - "revCount": 286, 858 + "rev": "06976dab800f19002798fe5be33733cb5a0ca835", 859 + "revCount": 294, 787 860 "type": "git", 788 861 "url": "https://codeberg.org/spoonbaker/mono" 789 862 }, ··· 898 971 "original": { 899 972 "owner": "Bwc9876", 900 973 "repo": "wayland-mpris-idle-inhibit", 974 + "type": "github" 975 + } 976 + }, 977 + "xwayland-satellite-stable": { 978 + "flake": false, 979 + "locked": { 980 + "lastModified": 1755491097, 981 + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", 982 + "owner": "Supreeeme", 983 + "repo": "xwayland-satellite", 984 + "rev": "388d291e82ffbc73be18169d39470f340707edaa", 985 + "type": "github" 986 + }, 987 + "original": { 988 + "owner": "Supreeeme", 989 + "ref": "v0.7", 990 + "repo": "xwayland-satellite", 991 + "type": "github" 992 + } 993 + }, 994 + "xwayland-satellite-unstable": { 995 + "flake": false, 996 + "locked": { 997 + "lastModified": 1762747449, 998 + "narHash": "sha256-Z1TKiux8K09a93w4PFDFsj8HFugXNy3iCC3Z8MpR5Rk=", 999 + "owner": "Supreeeme", 1000 + "repo": "xwayland-satellite", 1001 + "rev": "6338574bc5c036487486acde264f38f39ea15fad", 1002 + "type": "github" 1003 + }, 1004 + "original": { 1005 + "owner": "Supreeeme", 1006 + "repo": "xwayland-satellite", 901 1007 "type": "github" 902 1008 } 903 1009 }
+24 -33
flake.nix
··· 10 10 hm.url = "github:nix-community/home-manager"; 11 11 hm.inputs.nixpkgs.follows = "nixpkgs"; 12 12 nixos-hardware.url = "github:NixOS/nixos-hardware"; 13 - # lanzaboote.url = "github:nix-community/lanzaboote"; 14 - # lanzaboote.inputs.nixpkgs.follows = "nixpkgs"; 13 + lanzaboote.url = "github:nix-community/lanzaboote"; 14 + lanzaboote.inputs.nixpkgs.follows = "nixpkgs"; 15 15 wayland-mpris-idle-inhibit.url = "github:Bwc9876/wayland-mpris-idle-inhibit"; 16 16 wayland-mpris-idle-inhibit.inputs.nixpkgs.follows = "nixpkgs"; 17 17 fenix.url = "github:nix-community/fenix/monthly"; ··· 27 27 gh-grader-preview.inputs.nixpkgs.follows = "nixpkgs"; 28 28 bingus.url = "github:Bwc9876/bingus-bot"; 29 29 bingus.inputs.nixpkgs.follows = "nixpkgs"; 30 - 31 - lanzaboote = { 32 - url = "github:nix-community/lanzaboote"; 33 - inputs = { 34 - nixpkgs.follows = "nixpkgs"; 35 - rust-overlay.follows = "rust-overlay"; 36 - }; 37 - }; 38 - rust-overlay = { 39 - url = "github:oxalica/rust-overlay"; 40 - inputs.nixpkgs.follows = "nixpkgs"; 41 - }; 30 + niri.url = "github:sodiboo/niri-flake"; 31 + niri.inputs.nixpkgs.follows = "nixpkgs"; 42 32 43 33 spoon.url = "git+https://codeberg.org/spoonbaker/mono"; 44 34 spoon.inputs = { ··· 49 39 }; 50 40 }; 51 41 52 - outputs = inputs @ { 53 - self, 54 - nixpkgs, 55 - flakelight, 56 - nix-index-db, 57 - hm, 58 - nixos-hardware, 59 - lanzaboote, 60 - wayland-mpris-idle-inhibit, 61 - fenix, 62 - catppuccin, 63 - nixvim, 64 - imperm, 65 - nu_plugin_dbus, 66 - bingus, 67 - spoon, 68 - gh-grader-preview, 69 - rust-overlay, 70 - }: 42 + outputs = 43 + inputs@{ 44 + self, 45 + nixpkgs, 46 + flakelight, 47 + nix-index-db, 48 + hm, 49 + nixos-hardware, 50 + lanzaboote, 51 + wayland-mpris-idle-inhibit, 52 + fenix, 53 + catppuccin, 54 + nixvim, 55 + imperm, 56 + nu_plugin_dbus, 57 + bingus, 58 + spoon, 59 + gh-grader-preview, 60 + niri, 61 + }: 71 62 flakelight ./. { 72 63 imports = [ 73 64 spoon.flakelightModules.repl
+381 -346
homeModules/gdi.nix
··· 1 - {inputs, ...}: { 1 + { inputs, ... }: 2 + { 2 3 config, 3 4 lib, 4 5 pkgs, 5 6 ... 6 - }: { 7 + }: 8 + { 9 + imports = [ inputs.niri.homeModules.niri ]; 10 + 11 + # TODO: Replace Hyprland with Niri, switch out gdi.nix for this 7 12 options.cow.gdi = { 8 - enable = lib.mkEnableOption "Cow GDI, a 'DE' by ur favorite polish cow"; 9 - doIdle = lib.mkEnableOption "Screen locking and suspend with Hypridle"; 10 - useUWSM = lib.mkEnableOption "Use UWSM to launch apps"; 13 + enable = lib.mkEnableOption "Niri + Customizations"; 14 + doIdle = lib.mkEnableOption "Turn off screen, sleep, etc. from inactivity"; 11 15 }; 12 16 13 - config = let 14 - runCmd = cmd: 15 - if config.cow.gdi.useUWSM 16 - then "uwsm app -- ${cmd}" 17 - else cmd; 18 - launchDesktopApp = deskFile: 19 - if config.cow.gdi.useUWSM 20 - then "uwsm app -- ${deskFile}" 21 - else "${pkgs.gtk3}/bin/gtk-launch ${deskFile}"; 22 - screenOffCmd = "hyprctl dispatch dpms off; ${pkgs.swaynotificationcenter}/bin/swaync-client --inhibitor-add \"timeout\""; 23 - screenOnCmd = "hyprctl dispatch dpms on; ${pkgs.swaynotificationcenter}/bin/swaync-client --inhibitor-remove \"timeout\""; 24 - iconTheme = { 25 - name = "Tela-green"; 26 - package = pkgs.tela-icon-theme; 27 - }; 28 - cursorTheme = { 29 - name = "catppuccin-mocha-dark-cursors"; 30 - package = pkgs.catppuccin-cursors.mochaDark; 31 - size = 24; 32 - }; 33 - hyprThemeName = "${cursorTheme.name}-hypr"; 34 - hyprCursorTheme = let 35 - utils = "${pkgs.hyprcursor}/bin/hyprcursor-util"; 17 + config = 18 + let 19 + iconTheme = { 20 + name = "Tela-green"; 21 + package = pkgs.tela-icon-theme; 22 + }; 23 + cursorTheme = { 24 + name = "catppuccin-mocha-dark-cursors"; 25 + package = pkgs.catppuccin-cursors.mochaDark; 26 + size = 24; 27 + }; 36 28 in 37 - pkgs.runCommand hyprThemeName {} '' 38 - export PATH="$PATH:${pkgs.xcur2png}/bin" 39 - ${utils} -x ${cursorTheme.package}/share/icons/${cursorTheme.name} --output . 40 - mkdir -p $out/share/icons 41 - ${utils} -c ./extracted_${cursorTheme.name} --output . 42 - cp -r "./theme_Extracted Theme" $out/share/icons/${hyprThemeName} 43 - ''; 44 - in 45 29 lib.mkIf config.cow.gdi.enable { 30 + nixpkgs.overlays = [ inputs.niri.overlays.niri ]; 31 + 32 + # Me when I'm stupid and enable my preferred keyring unconditionally in a flake for a WM 33 + services.gnome-keyring.enable = lib.mkForce false; 34 + 46 35 home.packages = with pkgs; [ 47 36 alsa-utils 48 37 49 - hyprCursorTheme 50 38 cursorTheme.package 51 39 iconTheme.package 52 40 53 41 wezterm 54 42 55 43 # Shell Components 56 - hyprpicker 57 44 hyprlock 58 - hyprland-qtutils 59 45 60 46 ## Waybar 61 47 qt6.qttools # For component ··· 67 53 grim 68 54 xdg-utils 69 55 grimblast 70 - tesseract 71 56 swappy 72 57 libnotify 73 58 swaynotificationcenter ··· 90 75 91 76 fonts.fontconfig.enable = false; 92 77 93 - wayland.windowManager.hyprland = { 94 - systemd.enable = false; 78 + programs.niri = { 95 79 enable = true; 96 - extraConfig = '' 97 - bind = SUPER,M,submap,passthru 98 - submap = passthru 99 - bind = SUPER,ESCAPE,submap,reset 100 - submap = reset 101 - ''; 102 80 settings = { 103 - autogenerated = 0; 104 - ecosystem = { 105 - no_update_news = true; 106 - no_donation_nag = true; 107 - }; 108 - cursor = { 109 - no_hardware_cursors = true; 110 - enable_hyprcursor = false; 81 + prefer-no-csd = true; 82 + 83 + environment = { 84 + NIXOS_OZONE_WL = "1"; 111 85 }; 112 - monitor = [ 113 - ",highres,auto,1" 86 + 87 + screenshot-path = "~/Pictures/Screenshots/%Y%m%d_%H%M%S.png"; 88 + 89 + xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite-unstable; 90 + 91 + window-rules = [ 92 + { 93 + geometry-corner-radius = 94 + let 95 + s = 10.0; 96 + in 97 + { 98 + top-left = s; 99 + top-right = s; 100 + bottom-left = s; 101 + bottom-right = s; 102 + }; 103 + clip-to-geometry = true; 104 + } 114 105 ]; 115 - general = { 116 - border_size = 2; 117 - resize_on_border = true; 118 - "col.active_border" = "$red $peach $yellow $green $sapphire $lavender $mauve 225deg"; 119 - }; 120 - decoration = { 121 - rounding = 10; 106 + 107 + hotkey-overlay = { 108 + hide-not-bound = true; 109 + skip-at-startup = true; 122 110 }; 111 + 112 + clipboard.disable-primary = true; 113 + 123 114 input = { 124 - numlock_by_default = true; 125 - kb_options = "caps:escape"; 126 - touchpad = { 127 - natural_scroll = true; 115 + focus-follows-mouse.enable = true; 116 + keyboard.numlock = true; 117 + # power-key-handling.enable = false; 118 + touchpad.natural-scroll = true; 119 + }; 120 + 121 + layout = { 122 + default-column-width.proportion = 1.; 123 + focus-ring.active.gradient = { 124 + in' = "oklab"; 125 + angle = 135; 126 + relative-to = "workspace-view"; 127 + from = "#74c7ec"; 128 + to = "#cba6f7"; 128 129 }; 129 130 }; 130 - xwayland = { 131 - force_zero_scaling = true; 132 - }; 133 - # debug = { 134 - # disable_logs = false; 135 - # }; 136 - misc = { 137 - enable_swallow = true; 138 - disable_hyprland_logo = true; 139 - disable_splash_rendering = true; 140 - focus_on_activate = true; 141 - mouse_move_enables_dpms = true; 142 - key_press_enables_dpms = true; 143 - }; 144 - env = [ 145 - "TERMINAL,wezterm" 146 - "GRIMBLAST_EDITOR,swappy -f " 147 - "QT_QPA_PLATFORM,wayland;xcb" 148 - "QT_AUTO_SCREEN_SCALE_FACTOR,1" 149 - "HYPRCURSOR_THEME,${hyprThemeName}" 150 - "HYPRCURSOR_SIZE,${builtins.toJSON cursorTheme.size}" 151 - ]; 152 - windowrulev2 = [ 153 - "idleinhibit fullscreen,class:(.*),title:(.*)" 154 - ]; 155 - submap = "reset"; 156 - gesture = [ 157 - "3,horizontal,workspace" 158 - "4,swipe,move" 159 - ]; 160 - bind = let 161 - powerMenu = "rofi -modi 'p:${pkgs.rofi-power-menu}/bin/rofi-power-menu' -show p"; 162 - screenshot = "${pkgs.nushell}/bin/nu ${../res/screenshot.nu}"; 163 131 164 - openTerminal = launchDesktopApp "org.wezfurlong.wezterm.desktop"; 165 - forEachWorkspace = { 166 - mod, 167 - dispatch, 168 - }: 169 - builtins.genList ( 170 - i: let 171 - num = builtins.toString i; 172 - in "${mod},${num},${dispatch},${ 173 - if num == "0" 174 - then "10" 175 - else num 176 - }" 177 - ) 178 - 10; 179 - in 180 - [ 181 - "SUPER,M,submap,passthru" 182 - ] 183 - ++ lib.optionals config.cow.firefox.enable [ 184 - "SUPER,Q,exec,${launchDesktopApp "firefox-devedition.desktop"}" 185 - ] 186 - ++ [ 187 - "SUPER,Z,exec,systemctl suspend" 188 - ",XF86AudioMedia,exec,${openTerminal}" 189 - "SUPER,T,exec,${openTerminal}" 190 - "SUPER ALT CTRL SHIFT,L,exec,xdg-open https://linkedin.com" 191 - "SUPER,C,killactive," 192 - "SUPER,P,pseudo," 193 - "SUPER,R,togglefloating," 194 - "SUPER,F,fullscreen,1" 195 - "SUPER SHIFT,F,fullscreen,0" 196 - ",XF86RFKill,exec,rfkill toggle wifi" 197 - "SUPER,left,workspace,r-1" 198 - "SUPER,right,workspace,r+1" 199 - "SUPER SHIFT,left,movetoworkspace,r-1" 200 - "SUPER SHIFT,right,movetoworkspace,r+1" 201 - "SUPER,L,exec,pidof hyprlock || hyprlock --immediate" 202 - "SUPER,S,exec,${runCmd "rofi -show drun -show-icons"}" 203 - "SUPER SHIFT,E,exec,${runCmd "rofi -modi emoji -show emoji"}" 204 - "SUPER SHIFT,D,exec,swaync-client -d" 205 - "SUPER,Delete,exec,${runCmd powerMenu}" 206 - ",XF86PowerOff,exec,${runCmd powerMenu}" 207 - "SUPER ALT,C,exec,${runCmd "rofi -show calc -modi calc -no-show-match -no-sort -calc-command \"echo -n '{result}' | wl-copy\""}" 208 - "SUPER,B,exec,${runCmd "${pkgs.rofi-bluetooth}/bin/rofi-bluetooth"}" 209 - "SUPER,Tab,exec,${runCmd "rofi -show window -show-icons"}" 210 - ] 211 - ++ lib.optionals config.cow.yazi.enable ["SUPER,E,exec,${launchDesktopApp "yazi.desktop"}"] 212 - ++ [ 213 - "SUPER,N,exec,${runCmd "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"}" 214 - "SUPER,A,exec,${runCmd "${pkgs.pavucontrol}/bin/pavucontrol --tab 5"}" 215 - ''SUPER,V,exec,cliphist list | sed -r 's/\[\[ binary data (.* .iB) (.*) (.*) \]\]/ 󰋩 \2 Image (\3, \1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy'' 216 - "SUPER ALT,V,exec,echo -e \"Yes\\nNo\" | [[ $(rofi -dmenu -mesg \"Clear Clipboard History?\" -p Clear) == \"Yes\" ]] && cliphist wipe" 217 - ",Print,exec,${runCmd screenshot}" 218 - "SUPER SHIFT,S,exec,${runCmd screenshot}" 219 - "SUPER SHIFT,T,exec,${runCmd "${pkgs.nushell}/bin/nu ${../res/ocr.nu}"}" 220 - "SUPER SHIFT,C,exec,${runCmd "${pkgs.hyprpicker}/bin/hyprpicker -a"}" 221 - ] 222 - ++ forEachWorkspace { 223 - mod = "SUPER"; 224 - dispatch = "workspace"; 225 - } 226 - ++ forEachWorkspace { 227 - mod = "SUPER SHIFT"; 228 - dispatch = "movetoworkspace"; 132 + binds = 133 + with config.lib.niri.actions; 134 + let 135 + spawnPkg = p: spawn "${lib.getExe p}"; 136 + move-column-to-workspace = n: { move-column-to-workspace = [ n ]; }; 137 + terminal = pkgs.wezterm; 138 + spawnTerm = spawnPkg terminal; 139 + spawnNu = spawnPkg pkgs.nushell; 140 + spawnPlayerctl = spawnPkg pkgs.playerctl; 141 + spawnRofi = spawn "rofi"; 142 + spawnSh = spawn "sh" "-c"; 143 + spawnOsd = spawn "${pkgs.swayosd}/bin/swayosd-client"; 144 + launchDesktop = x: spawn "${pkgs.gtk3}/bin/gtk-launch" "${x}.desktop"; 145 + brightness = spawnOsd "--brightness"; 146 + volume = spawnOsd "--output-volume"; 147 + in 148 + { 149 + # Niri Stuff 150 + 151 + ## Basics 152 + "Mod+X".action = quit; 153 + "Mod+Tab".action = toggle-overview; 154 + "Mod+Slash".action = show-hotkey-overlay; 155 + "Mod+C".action = close-window; 156 + 157 + "Mod+Left".action = focus-column-left; 158 + "Mod+Down".action = focus-window-down; 159 + "Mod+Up".action = focus-window-up; 160 + "Mod+Right".action = focus-column-right; 161 + 162 + "Mod+Shift+Left".action = move-column-left; 163 + "Mod+Shift+Down".action = move-window-down; 164 + "Mod+Shift+Up".action = move-window-up; 165 + "Mod+Shift+Right".action = move-column-right; 166 + 167 + "Mod+Home".action = focus-column-first; 168 + "Mod+End".action = focus-column-last; 169 + "Mod+Shift+Home".action = move-column-to-first; 170 + "Mod+Shift+End".action = move-column-to-last; 171 + 172 + "Mod+BracketLeft".action = consume-or-expel-window-left; 173 + "Mod+BracketRight".action = consume-or-expel-window-right; 174 + 175 + "Mod+F".action = maximize-column; 176 + "Mod+Shift+F".action = fullscreen-window; 177 + "Mod+Ctrl+F".action = expand-column-to-available-width; 178 + "Mod+Ctrl+Shift+F".action = toggle-windowed-fullscreen; 179 + 180 + "Mod+Page_Down".action = focus-workspace-down; 181 + "Mod+Page_Up".action = focus-workspace-up; 182 + "Mod+U".action = focus-workspace-down; 183 + "Mod+I".action = focus-workspace-up; 184 + "Mod+Shift+Page_Down".action = move-column-to-workspace-down; 185 + "Mod+Shift+Page_Up".action = move-column-to-workspace-up; 186 + "Mod+Shift+U".action = move-column-to-workspace-down; 187 + "Mod+Shift+I".action = move-column-to-workspace-up; 188 + 189 + "Mod+1".action = focus-workspace 1; 190 + "Mod+2".action = focus-workspace 2; 191 + "Mod+3".action = focus-workspace 3; 192 + "Mod+4".action = focus-workspace 4; 193 + "Mod+5".action = focus-workspace 5; 194 + "Mod+6".action = focus-workspace 6; 195 + "Mod+7".action = focus-workspace 7; 196 + "Mod+8".action = focus-workspace 8; 197 + "Mod+9".action = focus-workspace 9; 198 + "Mod+Ctrl+1".action = move-column-to-workspace 1; 199 + "Mod+Ctrl+2".action = move-column-to-workspace 2; 200 + "Mod+Ctrl+3".action = move-column-to-workspace 3; 201 + "Mod+Ctrl+4".action = move-column-to-workspace 4; 202 + "Mod+Ctrl+5".action = move-column-to-workspace 5; 203 + "Mod+Ctrl+6".action = move-column-to-workspace 6; 204 + "Mod+Ctrl+7".action = move-column-to-workspace 7; 205 + "Mod+Ctrl+8".action = move-column-to-workspace 8; 206 + "Mod+Ctrl+9".action = move-column-to-workspace 9; 207 + 208 + "Mod+Escape" = { 209 + action = toggle-keyboard-shortcuts-inhibit; 210 + allow-inhibiting = false; 211 + }; 212 + 213 + "Mod+Shift+S".action = { 214 + screenshot = [ ]; 215 + }; 216 + "Print".action = { 217 + screenshot = [ ]; 218 + }; 219 + "Mod+L".action = spawnSh "pidof hyprlock || hyprlock --immediate"; 220 + "Mod+Z".action = spawn "systemctl" "suspend"; 221 + "Super+Alt+Ctrl+Shift+L".action = spawn "xdg-open" "https://linkedin.com"; 222 + 223 + # Terminal 224 + "Mod+T".action = spawnTerm; 225 + 226 + # Rofi 227 + "Mod+S".action = spawnRofi "-show" "drun" "-show-icons"; 228 + "Mod+B".action = spawnPkg pkgs.rofi-bluetooth; 229 + "Mod+Shift+E".action = spawnRofi "-modi" "emoji" "-show" "emoji"; 230 + "Mod+Alt+C".action = 231 + spawnRofi "-show" "calc" "-modi" "calc" "-no-show-match" "-no-sort" "-calc-command" 232 + "echo -n '{result}' | wl-copy"; 233 + "Mod+V".action = 234 + spawnSh "cliphist list | sed -r 's/\[\[ binary data (.* .iB) (.*) (.*) \]\]/ 󰋩 \2 Image (\3, \1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy"; 235 + "Mod+Alt+V".action = 236 + spawnSh "echo -e \"Yes\\nNo\" | [[ $(rofi -dmenu -mesg \"Clear Clipboard History?\" -p Clear) == \"Yes\" ]] && cliphist wipe"; 237 + 238 + # Yazi 239 + "Mod+E".action = lib.mkIf config.cow.yazi.enable (launchDesktop "yazi"); 240 + 241 + # Firefox 242 + "Mod+Q".action = lib.mkIf config.cow.firefox.enable (launchDesktop "firefox-devedition"); 243 + 244 + # Pavucontrol 245 + "Mod+A".action = spawnPkg pkgs.pavucontrol "--tab" "5"; 246 + 247 + # Brightness 248 + "XF86MonBrightnessUp" = { 249 + action = brightness "raise"; 250 + allow-when-locked = true; 251 + }; 252 + "XF86MonBrightnessDown" = { 253 + action = brightness "lower"; 254 + allow-when-locked = true; 255 + }; 256 + 257 + # Volume 258 + "XF86AudioRaiseVolume" = { 259 + action = volume "raise"; 260 + allow-when-locked = true; 261 + }; 262 + "XF86AudioLowerVolume" = { 263 + action = volume "lower"; 264 + allow-when-locked = true; 265 + }; 266 + "XF86AudioMute" = { 267 + action = volume "mute-toggle"; 268 + allow-when-locked = true; 269 + }; 270 + 271 + # Playerctl 272 + "XF86AudioPlay" = { 273 + action = spawnPlayerctl "play-pause"; 274 + allow-when-locked = true; 275 + }; 276 + "XF86AudioPause" = { 277 + action = spawnPlayerctl "pause"; 278 + allow-when-locked = true; 279 + }; 280 + "XF86AudioStop" = { 281 + action = spawnPlayerctl "stop"; 282 + allow-when-locked = true; 283 + }; 284 + "XF86AudioNext" = { 285 + action = spawnPlayerctl "next"; 286 + allow-when-locked = true; 287 + }; 288 + "XF86AudioPrev" = { 289 + action = spawnPlayerctl "previous"; 290 + allow-when-locked = true; 291 + }; 229 292 }; 230 - bindr = [ 231 - "SUPER SHIFT,R,exec,pkill wf-recorder --signal SIGINT ||${runCmd "${pkgs.nushell}/bin/nu ${../res/screenrec.nu}"}" 232 - "CAPS,Caps_Lock,exec,swayosd-client --caps-lock" 233 - ",Scroll_Lock,exec,swayosd-client --scroll-lock" 234 - ",Num_Lock,exec,swayosd-client --num-lock" 235 - ]; 236 - bindl = [ 237 - ",switch:on:Lid Switch,exec,${screenOffCmd}" 238 - ",switch:off:Lid Switch,exec,${screenOnCmd}" 239 - ",XF86AudioPlay,exec,playerctl play-pause" 240 - ",XF86AudioPause,exec,playerctl pause" 241 - ",XF86AudioStop,exec,playerctl stop" 242 - ",XF86AudioNext,exec,playerctl next" 243 - ",XF86AudioPrev,exec,playerctl previous" 244 - ]; 245 - bindel = [ 246 - ",XF86MonBrightnessUp,exec,swayosd-client --brightness raise" 247 - ",XF86MonBrightnessDown,exec,swayosd-client --brightness lower" 248 - ",XF86AudioRaiseVolume,exec,swayosd-client --output-volume raise" 249 - ",XF86AudioLowerVolume,exec,swayosd-client --output-volume lower" 250 - ",XF86AudioMute,exec,swayosd-client --output-volume mute-toggle" 251 - ]; 252 - bindm = [ 253 - "SUPER,mouse:272,movewindow" 254 - "SUPER,mouse:273,resizewindow" 255 - ]; 256 293 }; 257 294 }; 258 295 ··· 364 401 365 402 catppuccin.rofi.enable = false; 366 403 367 - systemd.user.services = let 368 - target = config.wayland.systemd.target; 369 - mkShellService = { 370 - desc, 371 - service, 372 - }: { 373 - Install = { 374 - WantedBy = [target]; 375 - }; 404 + systemd.user.services = 405 + let 406 + target = config.wayland.systemd.target; 407 + mkShellService = 408 + { 409 + desc, 410 + service, 411 + }: 412 + { 413 + Install = { 414 + WantedBy = [ target ]; 415 + }; 376 416 377 - Unit = { 378 - ConditionEnvironment = "WAYLAND_DISPLAY"; 379 - Description = desc; 380 - After = [target]; 381 - PartOf = [target]; 382 - }; 417 + Unit = { 418 + ConditionEnvironment = "WAYLAND_DISPLAY"; 419 + Description = desc; 420 + After = [ target ]; 421 + PartOf = [ target ]; 422 + }; 383 423 384 - Service = service; 385 - }; 386 - in { 387 - battery-notif = mkShellService { 388 - desc = "Battery Notification Service"; 424 + Service = service; 425 + }; 426 + in 427 + { 428 + battery-notif = mkShellService { 429 + desc = "Battery Notification Service"; 389 430 390 - service = { 391 - ExecStart = "${pkgs.nushell}/bin/nu --plugins ${ 392 - inputs.nu_plugin_dbus.packages.${pkgs.system}.default 393 - } ${../res/battery_notif.nu}"; 394 - Restart = "on-failure"; 395 - RestartSec = "10"; 431 + service = { 432 + ExecStart = "${pkgs.nushell}/bin/nu --plugins ${ 433 + inputs.nu_plugin_dbus.packages.${pkgs.system}.default 434 + } ${../res/battery_notif.nu}"; 435 + Restart = "on-failure"; 436 + RestartSec = "10"; 437 + }; 396 438 }; 397 - }; 439 + 440 + swaybg = lib.mkIf config.cow.pictures.enable (mkShellService { 441 + desc = "Sway Background Image"; 442 + service = { 443 + ExecStart = "${lib.getExe pkgs.swaybg} --image ${config.cow.pictures.bg}"; 444 + Restart = "on-failure"; 445 + RestartSec = "10"; 446 + }; 447 + }); 398 448 399 - mpris-idle-inhibit = mkShellService { 400 - desc = "MPRIS Idle Inhibitor"; 449 + mpris-idle-inhibit = mkShellService { 450 + desc = "MPRIS Idle Inhibitor"; 401 451 402 - service = { 403 - ExecStart = ''${ 452 + service = { 453 + ExecStart = ''${ 404 454 inputs.wayland-mpris-idle-inhibit.packages.${pkgs.system}.default 405 455 }/bin/wayland-mpris-idle-inhibit --ignore "kdeconnect" --ignore "playerctld"''; 406 - Restart = "on-failure"; 407 - RestartSec = "10"; 456 + Restart = "on-failure"; 457 + RestartSec = "10"; 458 + }; 408 459 }; 409 460 }; 410 - }; 411 461 412 462 qt = { 413 463 enable = true; ··· 433 483 dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; 434 484 435 485 services = { 436 - hyprpolkitagent.enable = true; 437 - 438 - hyprpaper = { 439 - enable = true; 440 - settings = { 441 - ipc = "on"; 442 - splash = false; 443 - preload = ["${config.cow.pictures.bg}"]; 444 - wallpaper = [",${config.cow.pictures.bg}"]; 445 - }; 446 - }; 447 - 448 486 swaync = { 449 487 enable = true; 450 488 settings = { ··· 499 537 }; 500 538 }; 501 539 502 - hypridle = lib.mkIf config.cow.gdi.doIdle { 503 - enable = true; 504 - settings = { 505 - general = { 506 - lock_cmd = "pidof hyprlock || hyprlock --grace 5"; 507 - unlock_cmd = "pkill hyprlock --signal SIGUSR1"; 508 - before_sleep_cmd = "loginctl lock-session"; 509 - after_sleep_cmd = screenOnCmd; 510 - }; 511 - 512 - listener = let 513 - lockTimeout = 120; 514 - in [ 540 + swayidle = 541 + let 542 + lockCmd = args: "pidof hyprlock || ${lib.getExe pkgs.hyprlock} ${args}"; 543 + in 544 + lib.mkIf config.cow.gdi.doIdle { 545 + enable = false; 546 + timeouts = [ 515 547 { 516 - timeout = lockTimeout; # Lock the screen after 2 minutes of inactivity 517 - on-timeout = "loginctl lock-session"; 548 + timeout = 10; 549 + command = lockCmd "--grace 5"; 518 550 } 519 551 { 520 - timeout = lockTimeout + 120; # Turn off the screen 2 minutes after locking 521 - on-timeout = screenOffCmd; 522 - on-resume = screenOnCmd; 552 + timeout = 30; 553 + command = "${pkgs.systemd}/bin/systemctl suspend"; 523 554 } 555 + ]; 556 + events = [ 524 557 { 525 - timeout = lockTimeout + 600; # Suspend 10 minutes after locking 526 - on-timeout = "systemctl suspend"; 558 + event = "before-sleep"; 559 + command = lockCmd "--immediate"; 527 560 } 528 561 ]; 529 562 }; 530 - }; 531 563 532 564 cliphist = { 533 565 enable = true; ··· 572 604 rofi-pulse-select 573 605 ]; 574 606 }; 575 - theme = let 576 - inherit (config.lib.formats.rasi) mkLiteral; 577 - in { 578 - "@import" = "${config.catppuccin.sources.rofi}/themes/catppuccin-${config.catppuccin.rofi.flavor}.rasi"; 579 - "*" = 580 - (builtins.mapAttrs (name: value: mkLiteral "@${value}") { 581 - "bg0" = "base"; 582 - "bg1" = "mantle"; 583 - "bg2" = "crust"; 584 - "bg3" = config.catppuccin.accent; 585 - "fg0" = "subtext1"; 586 - "fg1" = "text"; 587 - "fg2" = "subtext0"; 588 - "fg3" = "overlay0"; 589 - "fg4" = "surface0"; 590 - }) 591 - // { 592 - font = mkLiteral ''"Roboto 14"''; 607 + theme = 608 + let 609 + inherit (config.lib.formats.rasi) mkLiteral; 610 + in 611 + { 612 + "@import" = 613 + "${config.catppuccin.sources.rofi}/themes/catppuccin-${config.catppuccin.rofi.flavor}.rasi"; 614 + "*" = 615 + (builtins.mapAttrs (name: value: mkLiteral "@${value}") { 616 + "bg0" = "base"; 617 + "bg1" = "mantle"; 618 + "bg2" = "crust"; 619 + "bg3" = config.catppuccin.accent; 620 + "fg0" = "subtext1"; 621 + "fg1" = "text"; 622 + "fg2" = "subtext0"; 623 + "fg3" = "overlay0"; 624 + "fg4" = "surface0"; 625 + }) 626 + // { 627 + font = mkLiteral ''"Roboto 14"''; 628 + background-color = mkLiteral ''transparent''; 629 + text-color = mkLiteral ''@fg0''; 630 + margin = mkLiteral ''0px''; 631 + padding = mkLiteral ''0px''; 632 + spacing = mkLiteral ''0px''; 633 + }; 634 + "window" = { 635 + location = mkLiteral ''north''; 636 + y-offset = mkLiteral ''calc(50% - 176px)''; 637 + width = mkLiteral ''600''; 638 + border-radius = mkLiteral ''24px''; 639 + background-color = mkLiteral ''@bg0''; 640 + }; 641 + "mainbox" = { 642 + padding = mkLiteral ''12px''; 643 + }; 644 + "inputbar" = { 645 + background-color = mkLiteral ''@bg1''; 646 + border-color = mkLiteral ''@bg3''; 647 + border = mkLiteral ''2px''; 648 + border-radius = mkLiteral ''16px''; 649 + padding = mkLiteral ''8px 16px''; 650 + spacing = mkLiteral ''8px''; 651 + children = mkLiteral ''[ prompt, entry ]''; 652 + }; 653 + "prompt" = { 654 + text-color = mkLiteral ''@fg2''; 655 + }; 656 + "entry" = { 657 + placeholder = mkLiteral ''"Search"''; 658 + placeholder-color = mkLiteral ''@fg3''; 659 + }; 660 + "message" = { 661 + margin = mkLiteral ''12px 0 0''; 662 + border-radius = mkLiteral ''16px''; 663 + border-color = mkLiteral ''@bg2''; 664 + background-color = mkLiteral ''@bg2''; 665 + }; 666 + "textbox" = { 667 + padding = mkLiteral ''8px 24px''; 668 + }; 669 + "listview" = { 593 670 background-color = mkLiteral ''transparent''; 594 - text-color = mkLiteral ''@fg0''; 595 - margin = mkLiteral ''0px''; 596 - padding = mkLiteral ''0px''; 597 - spacing = mkLiteral ''0px''; 671 + margin = mkLiteral ''12px 0 0''; 672 + lines = mkLiteral ''8''; 673 + columns = mkLiteral ''2''; 674 + fixed-height = mkLiteral ''false''; 598 675 }; 599 - "window" = { 600 - location = mkLiteral ''north''; 601 - y-offset = mkLiteral ''calc(50% - 176px)''; 602 - width = mkLiteral ''600''; 603 - border-radius = mkLiteral ''24px''; 604 - background-color = mkLiteral ''@bg0''; 605 - }; 606 - "mainbox" = { 607 - padding = mkLiteral ''12px''; 608 - }; 609 - "inputbar" = { 610 - background-color = mkLiteral ''@bg1''; 611 - border-color = mkLiteral ''@bg3''; 612 - border = mkLiteral ''2px''; 613 - border-radius = mkLiteral ''16px''; 614 - padding = mkLiteral ''8px 16px''; 615 - spacing = mkLiteral ''8px''; 616 - children = mkLiteral ''[ prompt, entry ]''; 617 - }; 618 - "prompt" = { 619 - text-color = mkLiteral ''@fg2''; 620 - }; 621 - "entry" = { 622 - placeholder = mkLiteral ''"Search"''; 623 - placeholder-color = mkLiteral ''@fg3''; 624 - }; 625 - "message" = { 626 - margin = mkLiteral ''12px 0 0''; 627 - border-radius = mkLiteral ''16px''; 628 - border-color = mkLiteral ''@bg2''; 629 - background-color = mkLiteral ''@bg2''; 630 - }; 631 - "textbox" = { 632 - padding = mkLiteral ''8px 24px''; 633 - }; 634 - "listview" = { 635 - background-color = mkLiteral ''transparent''; 636 - margin = mkLiteral ''12px 0 0''; 637 - lines = mkLiteral ''8''; 638 - columns = mkLiteral ''2''; 639 - fixed-height = mkLiteral ''false''; 676 + "element" = { 677 + padding = mkLiteral ''8px 16px''; 678 + spacing = mkLiteral ''8px''; 679 + border-radius = mkLiteral ''16px''; 680 + }; 681 + "element normal active" = { 682 + text-color = mkLiteral ''@bg3''; 683 + }; 684 + "element alternate active" = { 685 + text-color = mkLiteral ''@bg3''; 686 + }; 687 + "element selected normal, element selected active" = { 688 + text-color = mkLiteral ''@fg4''; 689 + background-color = mkLiteral ''@bg3''; 690 + }; 691 + "element-icon" = { 692 + size = mkLiteral ''1em''; 693 + vertical-align = mkLiteral ''0.5''; 694 + }; 695 + "element-text" = { 696 + text-color = mkLiteral ''inherit''; 697 + }; 640 698 }; 641 - "element" = { 642 - padding = mkLiteral ''8px 16px''; 643 - spacing = mkLiteral ''8px''; 644 - border-radius = mkLiteral ''16px''; 645 - }; 646 - "element normal active" = { 647 - text-color = mkLiteral ''@bg3''; 648 - }; 649 - "element alternate active" = { 650 - text-color = mkLiteral ''@bg3''; 651 - }; 652 - "element selected normal, element selected active" = { 653 - text-color = mkLiteral ''@fg4''; 654 - background-color = mkLiteral ''@bg3''; 655 - }; 656 - "element-icon" = { 657 - size = mkLiteral ''1em''; 658 - vertical-align = mkLiteral ''0.5''; 659 - }; 660 - "element-text" = { 661 - text-color = mkLiteral ''inherit''; 662 - }; 663 - }; 664 699 location = "center"; 665 700 }; 666 701 nushell.extraConfig = ''
+15 -16
homeModules/keepassxc.nix
··· 1 - {...}: { 1 + { ... }: 2 + { 2 3 config, 3 4 lib, 4 5 pkgs, 5 6 ... 6 - }: { 7 + }: 8 + { 7 9 options.cow.keepassxc = { 8 10 enable = lib.mkEnableOption "KeePassXC + autolaunch"; 9 11 dbPath = lib.mkOption { ··· 14 16 }; 15 17 16 18 config = lib.mkIf config.cow.keepassxc.enable { 17 - cow.imperm.keepCache = [".config/keepassxc"]; 19 + cow.imperm.keepCache = [ ".config/keepassxc" ]; 18 20 19 - wayland.windowManager.hyprland.settings.exec-once = 21 + programs.niri.settings.spawn-at-startup = 20 22 lib.optionals (config.cow.gdi.enable && config.cow.keepassxc.dbPath != null) 21 - ( 22 - let 23 - cmd = "keepassxc ${config.cow.keepassxc.dbPath}"; 24 - in [ 25 - ( 26 - if config.cow.gdi.useUWSM 27 - then "uwsm app -- ${cmd}" 28 - else cmd 29 - ) 30 - ] 31 - ); 32 - home.packages = with pkgs; [keepassxc]; 23 + [ 24 + { 25 + argv = [ 26 + "keepassxc" 27 + config.cow.keepassxc.dbPath 28 + ]; 29 + } 30 + ]; 31 + home.packages = with pkgs; [ keepassxc ]; 33 32 }; 34 33 }
+2 -2
homeModules/waybar.nix
··· 521 521 warning = 70; 522 522 }; 523 523 }; 524 - modules-center = ["wlr/taskbar"]; 525 - modules-left = ["hyprland/workspaces"]; 524 + # modules-center = ["wlr/taskbar"]; 525 + # modules-left = ["hyprland/workspaces"]; 526 526 modules-right = [ 527 527 "temperature" 528 528 "cpu"
+2
nixosConfigurations/aperture.nix
··· 35 35 }; 36 36 }; 37 37 38 + home-manager.users.bean.programs.niri.settings.outputs."eDP-1".scale = 1; 39 + 38 40 programs.adb.enable = true; 39 41 40 42 cow = {
+14 -34
nixosModules/gdi.nix
··· 1 - {...}: { 1 + { ... }: 2 + { 2 3 config, 3 4 lib, 4 5 pkgs, 5 6 ... 6 - }: { 7 + }: 8 + { 7 9 options.cow.gdi = { 8 10 enable = lib.mkEnableOption "Hyprland with graphical apps, etc."; 9 11 doIdle = lib.mkEnableOption "Idling the system"; 10 - showGreet = lib.mkEnableOption "Show a greeter interface that runs UWSM to launch a Wayland window manager"; 12 + showGreet = lib.mkEnableOption "Show a greeter interface that runs a Wayland window manager"; 11 13 }; 12 14 13 15 config = lib.mkIf config.cow.gdi.enable { 14 - environment = { 15 - systemPackages = with pkgs; 16 - lib.mkIf config.cow.gdi.showGreet [ 17 - uwsm 18 - ]; 19 - variables = { 20 - NIXOS_OZONE_WL = "1"; 21 - _JAVA_AWT_WM_NONEREPARENTING = "1"; 22 - GDK_BACKEND = "wayland,x11"; 23 - ANKI_WAYLAND = "1"; 24 - MOZ_ENABLE_WAYLAND = "1"; 25 - XDG_SESSION_TYPE = "wayland"; 26 - SDL_VIDEODRIVER = "wayland"; 27 - CLUTTER_BACKEND = "wayland"; 28 - }; 29 - }; 30 - 31 - xdg.portal.extraPortals = with pkgs; [xdg-desktop-portal-gtk]; 32 - 33 - programs.hyprland = { 34 - enable = true; 35 - withUWSM = true; 36 - }; 16 + environment.pathsToLink = [ 17 + "/share/applications" 18 + "/share/xdg-desktop-portal" 19 + ]; 37 20 38 21 services.greetd = lib.mkIf config.cow.gdi.showGreet { 39 22 enable = true; 40 23 useTextGreeter = true; 41 - settings.default_session.command = let 42 - greeting = ''--greeting "Authenticate into ${lib.toUpper config.networking.hostName}"''; 43 - deCmd = pkgs.writeScript "start-session.sh" '' 44 - #!/usr/bin/env sh 45 - exec uwsm start ${pkgs.hyprland}/share/wayland-sessions/hyprland.desktop 46 - ''; 47 - cmd = ''--cmd "systemd-inhibit --what=handle-power-key:handle-lid-switch ${deCmd}"''; 48 - in "${pkgs.tuigreet}/bin/tuigreet --time ${greeting} ${cmd}"; 24 + settings.default_session.command = 25 + let 26 + greeting = ''--greeting "Authenticate into ${lib.toUpper config.networking.hostName}"''; 27 + in 28 + "${pkgs.tuigreet}/bin/tuigreet --time ${greeting} --cmd niri-session"; 49 29 }; 50 30 }; 51 31 }
-1
nixosModules/user-bean.nix
··· 28 28 cow.games.enable = config.cow.gaming.enable; 29 29 cow.gdi = { 30 30 inherit (config.cow.gdi) enable doIdle; 31 - useUWSM = true; 32 31 }; 33 32 }; 34 33 };