From 63670dd4c9365697addf010e43a1d2094c57c57c Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sat, 18 Jul 2026 14:13:16 +0200 Subject: [PATCH] Home: Re-enable Hyprland (HDR test) --- home/christoph/default.nix | 186 +++++++++++++++++- home/christoph/nixinator/default.nix | 76 ++++++- home/homemodules/default.nix | 1 + .../{1_deprecated => }/hyprland/autostart.nix | 0 .../{1_deprecated => }/hyprland/caelestia.nix | 0 .../{1_deprecated => }/hyprland/default.nix | 0 .../{1_deprecated => }/hyprland/dunst.nix | 0 .../{1_deprecated => }/hyprland/hypridle.nix | 0 .../hyprland/hyprland-nixinator.nix | 0 .../{1_deprecated => }/hyprland/hyprland.nix | 0 .../{1_deprecated => }/hyprland/hyprlock.nix | 0 .../{1_deprecated => }/hyprland/hyprpaper.nix | 0 .../{1_deprecated => }/hyprland/mappings.nix | 0 .../{1_deprecated => }/hyprland/options.nix | 0 .../{1_deprecated => }/hyprland/settings.nix | 0 home/homemodules/niri/default.nix | 2 +- system/default.nix | 2 +- system/nixinator/default.nix | 6 + system/nixinator/hardware-configuration.nix | 3 + 19 files changed, 266 insertions(+), 10 deletions(-) rename home/homemodules/{1_deprecated => }/hyprland/autostart.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/caelestia.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/default.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/dunst.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/hypridle.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/hyprland-nixinator.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/hyprland.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/hyprlock.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/hyprpaper.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/mappings.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/options.nix (100%) rename home/homemodules/{1_deprecated => }/hyprland/settings.nix (100%) diff --git a/home/christoph/default.nix b/home/christoph/default.nix index 7dbed2f..8de3465 100644 --- a/home/christoph/default.nix +++ b/home/christoph/default.nix @@ -77,6 +77,188 @@ in disableTabBar = true; }; + hyprland = { + enable = nixosConfig.programs.hyprland.enable; + dunst.enable = !config.homemodules.hyprpanel.enable; # Disable for hyprpanel + bars.enable = false; + dynamicCursor.enable = false; + trails.enable = true; + hyprspace.enable = false; # Always broken + hyprpanel.enable = false; + caelestia.enable = false; + + keybindings = { + main-mod = "SUPER"; + + bindings = lib.mergeAttrsList [ + # Use Rofi if we don't have caelestia + (lib.optionalAttrs (!config.homemodules.hyprland.caelestia.enable) { + "$mainMod, a" = ["exec, rofi -drun-show-actions -show drun"]; + "$mainMod, c" = ["exec, clipman pick --tool=rofi"]; + "$mainMod SHIFT, l" = ["exec, loginctl lock-session"]; + }) + + # Caelestia + (lib.optionalAttrs (config.homemodules.hyprland.caelestia.enable) { + "$mainMod, a" = ["exec, caelestia shell drawers toggle launcher"]; + # "$mainMod, c" = ["exec, caelestia clipboard"]; + "$mainMod SHIFT, l" = ["exec, caelestia shell lock lock"]; + + "$mainMod, escape" = ["exec, caelestia shell drawers toggle session"]; + }) + + { + # Applications + "$mainMod, t" = ["exec, kitty"]; + "$mainMod, e" = ["exec, kitty --title=Yazi yazi"]; + "$mainMod, n" = ["exec, neovide"]; + # "$mainMod, r" = ["exec, kitty --title=Rmpc rmpc"]; + "$mainMod CTRL, n" = ["exec, kitty --title=Navi navi"]; + "$mainMod SHIFT, n" = ["exec, neovide ${config.paths.dotfiles}/navi/christoph.cheat"]; + "$mainMod SHIFT, f" = ["exec, neovide ${config.paths.dotfiles}/flake.nix"]; + # "ALT, tab" = ["exec, rofi -show window"]; + + # Screenshots + "$mainMod, p" = ["exec, hyprpicker --autocopy --format=hex"]; + "$mainMod, s" = ["exec, grim -g \"$(slurp)\""]; + "$mainMod SHIFT, s" = ["exec, grim -g \"$(slurp)\" - | wl-copy"]; + + # Audio + ", XF86AudioRaiseVolume" = ["exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"]; + ", XF86AudioLowerVolume" = ["exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-"]; + ", XF86AudioPlay" = ["exec, playerctl play-pause"]; + ", XF86AudioPrev" = ["exec, playerctl previous"]; + ", XF86AudioNext" = ["exec, playerctl next"]; + + # Brightness + ", XF86MonBrightnessDown" = ["exec, hyprctl hyprsunset gamma -10"]; + ", XF86MonBrightnessUp" = ["exec, hyprctl hyprsunset gamma +10"]; + "$mainMod, XF86MonBrightnessDown" = ["exec, hyprctl hyprsunset temperature 5750"]; + "$mainMod, XF86MonBrightnessUp" = ["exec, hyprctl hyprsunset identity"]; + + "CTRL ALT, f" = let + hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl"; + grep = "${pkgs.gnugrep}/bin/grep"; + awk = "${pkgs.gawk}/bin/gawk"; + notify = "${pkgs.libnotify}/bin/notify-send"; + + toggleMouseFocus = pkgs.writeScriptBin "hypr-toggle-mouse-focus" '' + CURRENT=$(${hyprctl} getoption input:follow_mouse | ${grep} int | ${awk} -F' ' '{print $2}') + + if [[ "$CURRENT" == "1" ]]; then + ${hyprctl} keyword input:follow_mouse 0 + ${notify} "Disabled Mouse Focus!" + else + ${hyprctl} keyword input:follow_mouse 1 + ${notify} "Enabled Mouse Focus!" + fi + ''; + in ["exec, ${toggleMouseFocus}/bin/hypr-toggle-mouse-focus"]; + + # "CTRL ALT, t" = ["exec, bash -c 'systemctl --user restart hyprpanel.service'"]; + } + ]; + + ws-bindings = { + # "" = ""; + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + "6" = "6"; + "7" = "7"; + "8" = "8"; + "9" = "9"; + "10" = "0"; + }; + + special-ws-bindings = { + "ferdium" = "x"; + "msty" = "z"; + "btop" = "b"; + "rmpc" = "r"; + }; + }; + + autostart = { + immediate = [ + "kitty --hold fastfetch" + # "zeal" + "nextcloud --background" + # "protonvpn-app" + + # "kdeconnect-indicator" # started by services.kdeconnect.indicator + ]; + + delayed = [ + # "keepassxc" # The tray doesn't work when started too early + ]; + + special-silent = { + # "ferdium" = ["ferdium"]; + # "msty" = ["msty"]; + # "btop" = ["kitty --title=Btop btop"]; + # "rmpc" = ["kitty --title=Rmpc rmpc"]; + }; + }; + + windowrules = [ + # Fix jetbrains tooltip flicker + "match:class ^(jetbrains-.*)$, match:title ^(win[0-9]+)$, float 1" + "match:class ^(jetbrains-.*)$, match:title ^(win[0-9]+)$, no_initial_focus 1" + ]; + + workspacerules = { + "1" = []; + "2" = ["neovide" "code-url-handler"]; + "3" = ["obsidian" "Zotero"]; + "4" = ["firefox" "Google-chrome" "chromium-browser" "org.qutebrowser.qutebrowser"]; + "5" = ["steam"]; + "6" = ["steam_app_(.+)"]; + "7" = ["signal"]; + "8" = ["tidal-hifi"]; + "9" = ["discord"]; + "10" = ["python3"]; + }; + + floating = [ + {class = "org.kde.polkit-kde-authentication-agent-1";} + { + class = "thunar"; + title = "File Operation Progress"; + } + {class = "ffplay";} + {class = "Unity";} + ]; + + transparent-opacity = "0.75"; + + transparent = [ + "kitty" + "Alacritty" + "discord" + "signal" + "vesktop" + "Spotify" + "tidal-hifi" + "obsidian" + "firefox" + "org.qutebrowser.qutebrowser" + "jetbrains-clion" + "jetbrains-idea" + "jetbrains-pycharm" + "jetbrains-rustrover" + "jetbrains-rider" + "jetbrains-webstorm" + "code-url-handler" + "neovide" + "steam" + "ferdium" + "Msty" + ]; + }; + mpd.enable = !headless; niri.enable = nixosConfig.programs.niri.enable; nnn.enable = false; # Use yazi @@ -136,9 +318,9 @@ in # Enable wayland XDG_SESSION_TYPE = "wayland"; - QT_QPA_PLATFORM = "wayland"; + QT_QPA_PLATFORM = "wayland;xcb"; NIXOS_OZONE_WL = "1"; - SDL_VIDEODRIVER = "wayland"; + # SDL_VIDEODRIVER = "wayland"; # Leave unset as gamescope uses xwayland # Run SSH_ASKPASS as GUI, not TTY for Obsidian git SSH_ASKPASS_REQUIRE = "prefer"; diff --git a/home/christoph/nixinator/default.nix b/home/christoph/nixinator/default.nix index 9e912ac..2843fe3 100644 --- a/home/christoph/nixinator/default.nix +++ b/home/christoph/nixinator/default.nix @@ -19,6 +19,54 @@ fcitx.enable = true; helix.enable = true; + + hyprland = { + keyboard = { + layout = "us"; + variant = "altgr-intl"; + option = "nodeadkeys"; + }; + + monitors = { + "DP-1" = { + width = 3440; + height = 1440; + rate = 165; + x = 1920; + y = 0; + scale = 1; + bitdepth = 10; + cm = "hdr"; + }; + + "DP-2" = { + width = 1920; + height = 1080; + rate = 60; + x = 0; + y = 0; + scale = 1; + }; + }; + + workspaces = { + "DP-1" = [1 2 3 4 5 6 7 8 9]; + "DP-2" = [10]; + }; + + autostart = { + delayed = [ + "fcitx5" + ]; + }; + + floating = [ + { + class = "fcitx"; + } + ]; + }; + waybar.monitors = ["DP-1" "DP-2"]; vscode.enable = true; zed.enable = true; @@ -408,10 +456,11 @@ packages = [ "com.valvesoftware.Steam" "com.valvesoftware.Steam.Utility.steamtinkerlaunch" - "org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/24.08" - "org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/24.08" + "org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/25.08" # TODO: Doesn't work + "org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/25.08" "io.github.Foldex.AdwSteamGtk" "com.vysp3r.ProtonPlus" + "com.github.Matoking.protontricks" # "net.davidotek.pupgui2" "org.prismlauncher.PrismLauncher" @@ -432,15 +481,30 @@ ]; }; - "com.valvesoftware.Steam".Context = { + "com.github.Matoking.protontricks".Context = { filesystems = [ + "${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam" "${config.home.homeDirectory}/Games" - - # This is Proton-GE installed from flatpak. ProtonUpQT doesn't require it. - "/var/lib/flatpak/runtime/com.valvesoftware.Steam.CompatibilityTool.Proton-GE" ]; }; + "com.valvesoftware.Steam" = { + Environment = { + PATH = "/app/bin:/app/utils/bin:/usr/bin:/usr/lib/extensions/vulkan/gamescope/bin"; + }; + Context = { + filesystems = [ + "${config.home.homeDirectory}/Games" + + # This is Proton-GE installed from flatpak. ProtonUpQT doesn't require it. + "/var/lib/flatpak/runtime/com.valvesoftware.Steam.CompatibilityTool.Proton-GE" + + # This is gamescope installed from flatpak + "/usr/lib/extensions/vulkan/gamescope/bin" + ]; + }; + }; + "net.davidotek.pupgui2".Context = { filesystems = [ "${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam" diff --git a/home/homemodules/default.nix b/home/homemodules/default.nix index 212a6e8..78ad9ac 100644 --- a/home/homemodules/default.nix +++ b/home/homemodules/default.nix @@ -16,6 +16,7 @@ ./fish ./git ./helix + ./hyprland ./jellyfin-tui ./kitty ./lazygit diff --git a/home/homemodules/1_deprecated/hyprland/autostart.nix b/home/homemodules/hyprland/autostart.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/autostart.nix rename to home/homemodules/hyprland/autostart.nix diff --git a/home/homemodules/1_deprecated/hyprland/caelestia.nix b/home/homemodules/hyprland/caelestia.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/caelestia.nix rename to home/homemodules/hyprland/caelestia.nix diff --git a/home/homemodules/1_deprecated/hyprland/default.nix b/home/homemodules/hyprland/default.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/default.nix rename to home/homemodules/hyprland/default.nix diff --git a/home/homemodules/1_deprecated/hyprland/dunst.nix b/home/homemodules/hyprland/dunst.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/dunst.nix rename to home/homemodules/hyprland/dunst.nix diff --git a/home/homemodules/1_deprecated/hyprland/hypridle.nix b/home/homemodules/hyprland/hypridle.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/hypridle.nix rename to home/homemodules/hyprland/hypridle.nix diff --git a/home/homemodules/1_deprecated/hyprland/hyprland-nixinator.nix b/home/homemodules/hyprland/hyprland-nixinator.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/hyprland-nixinator.nix rename to home/homemodules/hyprland/hyprland-nixinator.nix diff --git a/home/homemodules/1_deprecated/hyprland/hyprland.nix b/home/homemodules/hyprland/hyprland.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/hyprland.nix rename to home/homemodules/hyprland/hyprland.nix diff --git a/home/homemodules/1_deprecated/hyprland/hyprlock.nix b/home/homemodules/hyprland/hyprlock.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/hyprlock.nix rename to home/homemodules/hyprland/hyprlock.nix diff --git a/home/homemodules/1_deprecated/hyprland/hyprpaper.nix b/home/homemodules/hyprland/hyprpaper.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/hyprpaper.nix rename to home/homemodules/hyprland/hyprpaper.nix diff --git a/home/homemodules/1_deprecated/hyprland/mappings.nix b/home/homemodules/hyprland/mappings.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/mappings.nix rename to home/homemodules/hyprland/mappings.nix diff --git a/home/homemodules/1_deprecated/hyprland/options.nix b/home/homemodules/hyprland/options.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/options.nix rename to home/homemodules/hyprland/options.nix diff --git a/home/homemodules/1_deprecated/hyprland/settings.nix b/home/homemodules/hyprland/settings.nix similarity index 100% rename from home/homemodules/1_deprecated/hyprland/settings.nix rename to home/homemodules/hyprland/settings.nix diff --git a/home/homemodules/niri/default.nix b/home/homemodules/niri/default.nix index 342e63b..96c9933 100644 --- a/home/homemodules/niri/default.nix +++ b/home/homemodules/niri/default.nix @@ -136,7 +136,7 @@ in { sessionVariables = { QT_QPA_PLATFORMTHEME = "gtk3"; # For Noctalia - GDK_BACKEND = "wayland"; # For screen sharing + GDK_BACKEND = "wayland,x11"; # For screen sharing }; pointerCursor = { diff --git a/system/default.nix b/system/default.nix index de4da2e..913b52a 100644 --- a/system/default.nix +++ b/system/default.nix @@ -318,7 +318,7 @@ with mylib.networking; { gpu-screen-recorder.enable = !headless; hyprland = { - enable = false; + enable = true; # enable = !headless; package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; diff --git a/system/nixinator/default.nix b/system/nixinator/default.nix index 0859eee..d5d1eab 100644 --- a/system/nixinator/default.nix +++ b/system/nixinator/default.nix @@ -216,6 +216,12 @@ openFirewall = true; # Directly set port in firewall }; + # TODO: Doesn't work with steam flatpak + # gamescope = { + # enable = true; + # enableWsi = true; + # }; + ghidra = { enable = true; gdb = true; diff --git a/system/nixinator/hardware-configuration.nix b/system/nixinator/hardware-configuration.nix index aeb4868..6eed7ac 100644 --- a/system/nixinator/hardware-configuration.nix +++ b/system/nixinator/hardware-configuration.nix @@ -160,6 +160,9 @@ # https://discourse.nixos.org/t/nvidia-open-breaks-hardware-acceleration/58770/3 nvidia-vaapi-driver # Experimental, doesn't work with chromium + + # Hdr in games with DXVK_HDR=1 ENABLE_HDR_WSI=1 + vulkan-hdr-layer-kwin6 ]; };