Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion install/hardware/nvidia.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
if lspci | grep -qi 'nvidia'; then
# omarchy-hw-nvidia reads sysfs IDs. lspci would walk PCI config space and
# wake a runtime-suspended GPU, and Hyprland already uses the same helper.
if omarchy-hw-nvidia; then
# Check which kernel is installed and set appropriate headers package
KERNEL_PACKAGE=$(pacman -Qqs '^linux(-zen|-lts|-hardened|-t2|-ptl)?$' | head -1 || true)
[[ -n $KERNEL_PACKAGE ]] && omarchy-pkg-add "$KERNEL_PACKAGE-headers"
Expand Down
19 changes: 19 additions & 0 deletions test/shell.d/nvidia-hw-detect-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -euo pipefail

source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"

nvidia_sh="$ROOT/install/hardware/nvidia.sh"

grep -Fq 'omarchy-hw-nvidia' "$nvidia_sh" ||
fail "NVIDIA install uses the sysfs helper already used at session start"
! grep -Eq "lspci.*nvidia" "$nvidia_sh" ||
fail "NVIDIA install does not grep lspci for the GPU"

# The GSP / 580xx split already goes through the helpers; keep that pairing.
grep -Fq 'omarchy-hw-nvidia-gsp' "$nvidia_sh" ||
fail "NVIDIA install still chooses the GSP driver via sysfs"
grep -Fq 'omarchy-hw-nvidia-without-gsp' "$nvidia_sh" ||
fail "NVIDIA install still chooses the 580xx driver via sysfs"
pass "NVIDIA driver install detects the GPU the same way Hyprland does"