feat(hyprland): enable native Wayland for Electron apps

Set NIXOS_OZONE_WL in the compositor env so Chromium and Electron
wrappers select native Wayland rather than XWayland, which blurs at this
DPI. Deliver it through Hyprland's env directive because UWSM starts the
session without the shell profile home-manager's sessionVariables rely
on.
This commit is contained in:
2026-07-24 17:48:35 -04:00
parent 7409e4e6a0
commit 40ae623094

View File

@@ -63,19 +63,26 @@ in
"$mod" = "SUPER"; "$mod" = "SUPER";
"$terminal" = "alacritty"; "$terminal" = "alacritty";
# Hand the cursor theme to the compositor directly. # Session variables handed to the compositor directly.
# UWSM launches the session without the shell profile that carries the # UWSM launches the session without the shell profile that would carry
# pointer-cursor variables, so without this Hyprland never sees a theme # them, so a variable the compositor or its children must see is set
# and falls back to its built-in cursor. # here rather than through home-manager's sessionVariables.
# Bibata ships XCursor only. env =
# The hyprcursor variables name the same theme, which Hyprland resolves [
# through its XCursor fallback. # Chromium and Electron apps read this to select native Wayland;
env = lib.optionals (cursor != null) [ # nixpkgs wrappers (Obsidian's included) gate their Wayland flags on
"XCURSOR_THEME,${cursor.name}" # it, so without it they run under XWayland and blur at this DPI.
"XCURSOR_SIZE,${toString cursor.size}" "NIXOS_OZONE_WL,1"
"HYPRCURSOR_THEME,${cursor.name}" ]
"HYPRCURSOR_SIZE,${toString cursor.size}" # Bibata ships XCursor only.
]; # The hyprcursor variables name the same theme, which Hyprland
# resolves through its XCursor fallback.
++ lib.optionals (cursor != null) [
"XCURSOR_THEME,${cursor.name}"
"XCURSOR_SIZE,${toString cursor.size}"
"HYPRCURSOR_THEME,${cursor.name}"
"HYPRCURSOR_SIZE,${toString cursor.size}"
];
input = { input = {
kb_layout = "us"; kb_layout = "us";