iso: add bos-nvidia-setup for optional proprietary NVIDIA

Click-to-install path for machines first-boot already offers. Installs
nvidia + nvidia-utils (never cuda), writes ~/.config/hypr/nvidia.lua,
and hyprland.lua dofiles that file only if it exists. Mesa stays
unchanged. Not on the ISO. Reboot after.
This commit is contained in:
Breadway 2026-08-16 00:54:40 +08:00
parent 43c0a5e2b5
commit 863fb80de2
6 changed files with 193 additions and 4 deletions

View file

@ -47,6 +47,11 @@ PY
echo "== lockfile $LOCKFILE =="
echo " ${#REQUIRED_BINS[@]} required, ${#OPTIONAL_BINS[@]} optional"
if grep -qE '^nvidia(-utils|-dkms|-open)?$' "$REPO/iso/packages.x86_64"; then
bad "iso/packages.x86_64 lists an nvidia driver package"
else
ok "iso/packages.x86_64 has no nvidia driver package"
fi
echo "== host tools =="
if command -v grub-install >/dev/null 2>&1; then
ok "grub-install (uefi.grub bootmode)"
@ -140,6 +145,7 @@ if [[ -n "$AIROOTFS" || -n "$SKEL" ]]; then
for b in "${REQUIRED_BINS[@]}"; do
check_exec "$AIROOTFS/usr/local/bin/$b" "image required bin $b"
done
check_exec "$AIROOTFS/usr/local/bin/bos-nvidia-setup" "image bos-nvidia-setup"
check_dir "$AIROOTFS/usr/local/share/breadhelp/content" "image breadhelp content"
fi
if [[ -n "$SKEL" ]]; then
@ -152,6 +158,11 @@ if [[ -n "$AIROOTFS" || -n "$SKEL" ]]; then
fi
done
check_file "$SKEL/.config/hypr/hyprland.lua" "skel hyprland.lua"
if grep -q 'nvidia.lua' "$SKEL/.config/hypr/hyprland.lua"; then
ok "skel hyprland.lua includes nvidia.lua only if present"
else
bad "skel hyprland.lua does not mention nvidia.lua"
fi
fi
image_units_json=""
if [[ -n "$SKEL" && -f "$SKEL/.local/state/bakery/installed.json" ]]; then

View file

@ -67,6 +67,13 @@ check "breadhelp content installed" \
check "bos-netcheck present" "command -v bos-netcheck"
check "bos-rescue present" "command -v bos-rescue"
check "bos-first-boot present" "command -v bos-first-boot"
check "bos-nvidia-setup present" "command -v bos-nvidia-setup"
if pacman -Qq nvidia >/dev/null 2>&1; then
note "nvidia installed (optional proprietary path)"
check "nvidia env drop-in present" "[ -f \"\$HOME/.config/hypr/nvidia.lua\" ]"
else
check "nvidia not on the default image" "! pacman -Qq nvidia"
fi
echo "== bakery user units (global enable) =="
# A later useradd does not enable --user units unless they were enabled
@ -98,6 +105,8 @@ check "useradd SKEL is /etc/skel" \
echo "== default dotfiles =="
check "hyprland.lua present" "[ -f \"\$HOME/.config/hypr/hyprland.lua\" ]"
check "hyprland.lua includes nvidia.lua only if present" \
"grep -q 'nvidia.lua' \"\$HOME/.config/hypr/hyprland.lua\""
check "binds.json present" "[ -f \"\$HOME/.config/hypr/binds.json\" ]"
check "monitors.json present" "[ -f \"\$HOME/.config/hypr/monitors.json\" ]"
check "settings.json present" "[ -f \"\$HOME/.config/hypr/settings.json\" ]"