Backport of #11845 for v4-0-4. Supersedes #11729 with the final generic
kernel migration, without introducing the intermediate PTL migration.
Resolve against 4.0.3: remove the retired PTL installer, update the ISO
package list and NVIDIA headers, and retain the release hardware scope.
Cam Link and Dell sidecar support are absent from this release branch,
so omit their installer and test changes.
(cherry picked from commit 86a2e5830e)
34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
if lspci | grep -qi 'nvidia'; then
|
|
# Check which kernel is installed and set appropriate headers package
|
|
KERNEL_PACKAGE=$(pacman -Qqs '^linux(-zen|-lts|-hardened|-t2|-ptl|-omarchy(-bore|-ptl-novrr-mm)?)?$' | head -1 || true)
|
|
[[ -n $KERNEL_PACKAGE ]] && omarchy-pkg-add "$KERNEL_PACKAGE-headers"
|
|
|
|
if omarchy-hw-nvidia-gsp; then
|
|
PACKAGES=(nvidia-open-dkms nvidia-utils lib32-nvidia-utils libva-nvidia-driver)
|
|
elif omarchy-hw-nvidia-without-gsp; then
|
|
PACKAGES=(nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils)
|
|
fi
|
|
|
|
# Bail if no supported GPU
|
|
if [[ -z ${PACKAGES+x} ]]; then
|
|
echo "No compatible driver for your NVIDIA GPU. See: https://wiki.archlinux.org/title/NVIDIA"
|
|
exit 0
|
|
fi
|
|
|
|
omarchy-pkg-add "${PACKAGES[@]}"
|
|
|
|
# Per-session Hyprland NVIDIA env vars are handled by default/hypr/nvidia.lua.
|
|
|
|
# Configure modprobe for early KMS
|
|
mkdir -p /etc/modprobe.d
|
|
cat > /etc/modprobe.d/nvidia.conf <<'EOF'
|
|
options nvidia_drm modeset=1
|
|
EOF
|
|
|
|
# Configure mkinitcpio for early loading
|
|
mkdir -p /etc/mkinitcpio.conf.d
|
|
cat > /etc/mkinitcpio.conf.d/nvidia.conf <<'EOF'
|
|
MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
|
|
EOF
|
|
fi
|