diff --git a/lib/images/windows/helpers/customizeImage.nix b/lib/images/windows/helpers/customizeImage.nix index 652b2b4..79dc155 100644 --- a/lib/images/windows/helpers/customizeImage.nix +++ b/lib/images/windows/helpers/customizeImage.nix @@ -24,6 +24,7 @@ vncDisplay ? null, smp ? 4, memSize ? 4096, + nicModel ? null, }: let originalImageName = lib.strings.removeSuffix "-vmix" (lib.strings.removeSuffix ".qcow2" originalImage.name); @@ -104,7 +105,7 @@ then "-drive file=${resultImg},format=qcow2,if=none,id=disk0 -device ide-hd,drive=disk0" else "-drive file=${resultImg},format=qcow2,if=virtio"} \ ${cdromArgs} \ - -nic user,model=${if isAHCI then "e1000" else "virtio-net-pci"}" + -nic user,model=${if nicModel != null then nicModel else if isAHCI then "e1000" else "virtio-net-pci"}" timeout 1800 qemu-system-x86_64 $VMIX_DISPLAY $QEMU_ARGS || \ if [[ "$VMIX_DISPLAY" == "-display sdl" ]]; then diff --git a/lib/images/windows/templates/generalize.nix b/lib/images/windows/templates/generalize.nix index 76904f8..0caa5b9 100644 --- a/lib/images/windows/templates/generalize.nix +++ b/lib/images/windows/templates/generalize.nix @@ -21,6 +21,8 @@ in bgColor ? null, # Enable Remote Desktop for the created user (re-applied after sysprep) enableRDP ? false, + # NIC model for the build VM (e.g. "e1000" for images without VirtIO drivers) + nicModel ? null, # delayOobeRun = true: sysprep only, OOBE + activation on real hardware # delayOobeRun = false: sysprep + OOBE + activation in build VM delayOobeRun ? false, @@ -185,6 +187,7 @@ in ''; in { name = if delayOobeRun then "generalize-delay-oobe" else "generalize"; + inherit nicModel; uploads = [ { source = oobeXml; dest = "/oobe-unattend.xml"; } { source = postOobeScript; dest = "/post-oobe.cmd"; }