Move NVIDIA env setup to Hyprland Lua

Evaluate NVIDIA session env vars from default/hypr/nvidia.lua during Hyprland startup instead of appending them to each user's envs.lua during setup. This removes the per-user NVIDIA setup script execution while preserving the GSP/non-GSP detection.
This commit is contained in:
Ryan Hughes
2026-06-04 18:35:01 -04:00
parent 27f6d9d364
commit b45e8464ef
6 changed files with 34 additions and 23 deletions
-21
View File
@@ -1,21 +0,0 @@
envs="$HOME/.config/hypr/envs.lua"
[[ -f $envs ]] || exit 0
if lspci | grep -qi 'nvidia'; then
if omarchy-hw-nvidia-gsp && ! grep -q 'NVIDIA (Turing+ with GSP firmware)' "$envs"; then
cat >>"$envs" <<'EOF'
-- NVIDIA (Turing+ with GSP firmware)
hl.env("NVD_BACKEND", "direct")
hl.env("LIBVA_DRIVER_NAME", "nvidia")
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
EOF
elif omarchy-hw-nvidia-without-gsp && ! grep -q 'NVIDIA (Maxwell/Pascal/Volta without GSP firmware)' "$envs"; then
cat >>"$envs" <<'EOF'
-- NVIDIA (Maxwell/Pascal/Volta without GSP firmware)
hl.env("NVD_BACKEND", "egl")
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
EOF
fi
fi
+1 -1
View File
@@ -17,7 +17,7 @@ if lspci | grep -qi 'nvidia'; then
omarchy-pkg-add "${PACKAGES[@]}"
# Per-user Hyprland NVIDIA env vars are handled by nvidia-user.sh.
# Per-session Hyprland NVIDIA env vars are handled by default/hypr/nvidia.lua.
# Configure modprobe for early KMS
mkdir -p /etc/modprobe.d
-1
View File
@@ -7,4 +7,3 @@ run_logged $OMARCHY_INSTALL/config/hardware/bluetooth-user.sh
run_logged $OMARCHY_INSTALL/config/hardware/asus/fix-audio-mixer.sh
run_logged $OMARCHY_INSTALL/config/hardware/asus/fix-mic.sh
run_logged $OMARCHY_INSTALL/config/hardware/framework/fix-f13-amd-audio-input.sh
run_logged $OMARCHY_INSTALL/config/hardware/nvidia-user.sh