From f2f3ce2af81912b28e6f99c3f092300cf5b2c860 Mon Sep 17 00:00:00 2001 From: Atlas Yu Date: Fri, 19 Dec 2025 16:57:19 +0800 Subject: [PATCH] nixos/nixos-generate-config: fix intel-npu imports The generated configuration during the installation will failed to evaluate "error: The option `hardware.cpu.intel.npu' does not exist." on Intel CPUs have NPU support. - Fix this by adding the missing imports when PCI ID matches. - Also update the PCI ID list (linux v6.18). Closes: #470638 --- .../installer/tools/nixos-generate-config.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 77139976e7ad..bbd0a093b998 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -205,10 +205,15 @@ sub pciCheck { ($device eq "0x4229" || $device eq "0x4230" || $device eq "0x4222" || $device eq "0x4227"); - push @attrs, "hardware.cpu.intel.npu.enable = true;" if - $vendor eq "0x8086" && - ($device eq "0x7d1d" || $device eq "0xad1d" || - $device eq "0x643e" || $device eq "0xb03e"); + # Intel NPU driver + # list taken from linux(v6.18): drivers/accel/ivpu/ivpu_drv.h + if ($vendor eq "0x8086" && + ($device eq "0xfd3e" || $device eq "0x7d1d" || $device eq "0xad1d" || + $device eq "0x643e" || $device eq "0xb03e")) + { + push @imports, "(modulesPath + \"/hardware/cpu/intel-npu.nix\")"; + push @attrs, "hardware.cpu.intel.npu.enable = true;"; + } # Assume that all NVIDIA cards are supported by the NVIDIA driver. # There may be exceptions (e.g. old cards).