feat(install): #59 NVIDIA commented system.nix guidance
Some checks failed
Check / eval (push) Has been cancelled

When hardwareProfile includes common-gpu-nvidia, emit a comment-only
plain NixOS block (PRIME / powerManagement / open-module) in the
installer region of system.nix — same pattern as ROCm/NPU opt-ins.
HARDWARE.md §6 product direction marked shipped. Close #59.

Verified: V0 (patch-template smoke + negative + bash -n).
This commit is contained in:
Bernardo Magri
2026-07-10 08:30:51 +01:00
parent f09042adbe
commit 09388196a9
5 changed files with 37 additions and 14 deletions

View File

@@ -117,7 +117,10 @@ def build_installer_region(v: dict) -> str:
)
hw = v.get("hardware") or {}
if any(hw.get(k) for k in ("intel", "amd", "fingerprint", "cameraIr", "npu")):
if any(
hw.get(k)
for k in ("intel", "amd", "fingerprint", "cameraIr", "npu", "nvidia")
):
lines.append(" # Hardware enablement (auto-detected).")
if hw.get("intel"):
lines.append(
@@ -151,6 +154,17 @@ def build_installer_region(v: dict) -> str:
f" # nomarchy.hardware.npu.enable = true; # {vendor} NPU (experimental; userspace BYO)",
" # nomarchy.hardware.latestKernel = true; # if the NPU driver needs a newer kernel",
]
# NVIDIA: profile is in flake.nix (common-gpu-nvidia). Hybrid/PRIME
# knobs are plain NixOS — comment-only guidance, same pattern as ROCm.
if hw.get("nvidia"):
lines += [
" # NVIDIA: common-gpu-nvidia is in hardwareProfile (flake.nix).",
" # Hybrid/PRIME, power, open-module — plain NixOS; see docs/HARDWARE.md §6",
" # and https://wiki.nixos.org/wiki/Nvidia (bus IDs are machine-specific).",
" # hardware.nvidia.prime = { ... }; # offload/sync",
" # hardware.nvidia.powerManagement.enable = true; # suspend/resume",
" # hardware.nvidia.open = false; # true = open module (newer cards)",
]
if v.get("resumeOffset") is not None:
root_uuid = nix_str(v["rootUuid"])