Use the base module:
{
imports = [
nixos-hardware.nixosModules.framework-16-amd-ai-300-series
];
}If you have the Framework 16 NVIDIA dGPU module (GeForce RTX 5070 or similar), use the NVIDIA submodule:
{
imports = [
nixos-hardware.nixosModules.framework-16-amd-ai-300-series-nvidia
];
}This enables hybrid graphics with PRIME offload: the AMD iGPU runs by default for better battery life, and the NVIDIA dGPU can be used on demand with nvidia-offload <command>.
The default values are examples only and will likely not match your hardware. Due to Framework 16's modular design, bus IDs vary depending on installed expansion cards and NVMe drives:
{
hardware.nvidia.prime = {
amdgpuBusId = "PCI:195:0:0"; # Adjust to your system
nvidiaBusId = "PCI:194:0:0"; # Adjust to your system
};
}Find your bus IDs with:
$ nix-shell -p pciutils --run 'lspci | grep -E "VGA|3D|Display"'
c2:00.0 VGA compatible controller: NVIDIA Corporation ...
c3:00.0 Display controller: Advanced Micro Devices ...Convert the hex bus ID to decimal (e.g., c2:00.0 → PCI:194:0:0, c3:00.0 → PCI:195:0:0).
Helper:
# Replace BDF with the lspci value like c2:00.0
BDF="c2:00.0"
BUS="${BDF%%:*}"; REST="${BDF#*:}"
DEV="${REST%%.*}"; FUN="${REST#*.}"
printf 'PCI:%d:%d:%d\n' "$((16#$BUS))" "$((16#$DEV))" "$FUN"# Default should use AMD
nix-shell -p mesa-demos --run 'glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"'
# Offload should use NVIDIA
nix-shell -p mesa-demos --run 'nvidia-offload glxinfo -B | grep -E "OpenGL vendor|OpenGL renderer"'To check whether the NVIDIA GPU is runtime-suspending at idle:
# Reuse $BDF from above
cat /sys/bus/pci/devices/0000:$BDF/power/runtime_statusNote: running nvidia-smi can wake the GPU, so it is not a reliable “is it sleeping?” probe.
If you want an easy “iGPU-only” boot entry (to maximize battery life and avoid loading NVIDIA at all), you can enable the PRIME battery saver specialisation:
{
hardware.nvidia.primeBatterySaverSpecialisation = true;
}This creates an additional boot entry tagged battery-saver.
- If suspend/resume fails after heavy GPU/VRAM usage, see the NixOS NVIDIA wiki for power management / VRAM save notes: https://wiki.nixos.org/wiki/NVIDIA
Firmware is updatable via fwupd (enabled by default). To get the latest firmware:
$ fwupdmgr refresh
$ fwupdmgr update