# Autounattend.xml for unattended Windows installation into Audit Mode. # Minimal — only what's needed to install Windows and enter Audit Mode. # All customization (hostname, timezone, telemetry, UAC, etc.) is done via templates. { pkgs, lib, ... }: { locale ? "en-US", productKey ? "", diskIndex ? 0, imageIndex ? 1, efi ? true, virtioDriverLetter ? "E", bypassRequirements ? false, windowsVersionForVirtioDrivers }: pkgs.writeText "Autounattend.xml" '' ${locale} ${locale} ${locale} ${locale} ${locale} ${virtioDriverLetter}:\amd64\${windowsVersionForVirtioDrivers} ${lib.optionalString (productKey != "") '' ${productKey} ''} true /IMAGE/INDEX ${toString imageIndex} ${toString diskIndex} ${if efi then "3" else "1"} ${toString diskIndex} true ${if efi then '' 1 100 EFI 2 16 MSR 3 true Primary 1 1 FAT32 2 2 3 3 NTFS '' else '' 1 true Primary 1 1 NTFS true ''} ${lib.optionalString bypassRequirements '' 1 reg add HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1 /f 2 reg add HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1 /f 3 reg add HKLM\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 1 /f ''} 1 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v vmixCleanup /t REG_SZ /d "cmd /c del /q C:\Windows\Panther\unattend.xml" /f 2 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v vmixShutdown /t REG_SZ /d "shutdown /s /t 10 /c vmix-audit-ready" /f Audit ''