diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-24 04:47:45 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-29 03:50:29 +0530 |
| commit | 0bf2f48b23b34c61729618ec1643c18d9a61ce78 (patch) | |
| tree | 11b0444084f6d12ad80d93eb12e4fd04a6d6a9f7 /modules/desktop/niri/default.nix | |
| parent | d1e9362085cb9564ff7323cef1612d48b16eb40d (diff) | |
| download | home-manager-config-0bf2f48b23b34c61729618ec1643c18d9a61ce78.tar.gz home-manager-config-0bf2f48b23b34c61729618ec1643c18d9a61ce78.zip | |
desktop: switched to niri from hyprland
- window manager hopping now goes to niri from hyprland
- added niri configuration closely resembling the keybindings and visual
appearence as before
- updated all other modules like waybar to use niri instead of hyprland
Diffstat (limited to 'modules/desktop/niri/default.nix')
| -rw-r--r-- | modules/desktop/niri/default.nix | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/modules/desktop/niri/default.nix b/modules/desktop/niri/default.nix new file mode 100644 index 0000000..f1e0fa7 --- /dev/null +++ b/modules/desktop/niri/default.nix @@ -0,0 +1,110 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ ./keybindings.nix ]; + + options.desktop.hardware.gpu = { + nvidia.enable = lib.mkEnableOption "Nvidia GPU Wayland optimizations"; + amd.enable = lib.mkEnableOption "AMD GPU Wayland optimizations"; + }; + + config = lib.mkIf config.desktop.enable { + home.sessionVariables = lib.mkMerge [ + { + NIXOS_OZONE_WL = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + SDL_VIDEODRIVER = "wayland"; + CLUTTER_BACKEND = "wayland"; + GDK_SCALE = "1"; + QT_SCALE_FACTOR = "1"; + GTK_THEME = "Adwaita:dark"; + } + + (lib.mkIf config.desktop.hardware.gpu.nvidia.enable { + LIBVA_DRIVER_NAME = "nvidia"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + GBM_BACKEND = "nvidia-drm"; + __GL_YIELD = "USLEEP"; + __GL_VRR_ALLOWED = "0"; + }) + + (lib.mkIf config.desktop.hardware.gpu.amd.enable { + AMD_VULKAN_ICD = "RADV"; + MESA_VK_DEVICE_SELECT = "1002:"; + }) + ]; + + wayland.windowManager.niri = { + enable = true; + systemd.enable = true; + }; + + # Niri does not paint wallpapers itself, so start swaybg with the existing wallpaper. + home.packages = [ pkgs.swaybg ]; + + home.pointerCursor = { + enable = true; + package = pkgs.adwaita-icon-theme; + name = "Adwaita"; + size = 20; + gtk.enable = true; + x11.enable = true; + }; + + wayland.windowManager.niri.extraConfigEarly = '' + input { + keyboard { + xkb { + layout "us" + } + } + touchpad { + natural-scroll + tap + dwt + click-method "clickfinger" + accel-speed 0.5 + } + } + + layout { + gaps 5 + center-focused-column "on-overflow" + default-column-width { proportion 1.0; } + preset-column-widths { + proportion 0.5 + proportion 1.0 + } + focus-ring { + width 1 + active-color "${config.scheme.withHashtag.base07}" + inactive-color "${config.scheme.withHashtag.base03}" + } + border { off; } + shadow { off; } + } + + prefer-no-csd + screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" + animations { off; } + + spawn-at-startup "${lib.getExe pkgs.swaybg}" "-i" "${../../../assets/sapling.png}" "-m" "fill" + + // Keep the familiar numbered workspaces persistent; Niri otherwise uses dynamic workspaces. + workspace "1" + workspace "2" + workspace "3" + workspace "4" + workspace "5" + workspace "6" + workspace "7" + workspace "8" + workspace "9" + workspace "10" + ''; + }; +} |
