diff --git a/wfvm/autounattend.nix b/wfvm/autounattend.nix
index a903133..8af25f7 100644
--- a/wfvm/autounattend.nix
+++ b/wfvm/autounattend.nix
@@ -15,6 +15,7 @@
, impureShellCommands ? []
, driveLetter ? "D:"
, efi ? true
+, imageSelection ? "Windows 10 Pro"
, ...
}:
@@ -203,8 +204,8 @@ let
- /IMAGE/INDEX
- 1
+ /IMAGE/NAME
+ ${imageSelection}
@@ -302,7 +303,7 @@ let
-
+
'';
diff --git a/wfvm/win.nix b/wfvm/win.nix
index 5dab9ba..6c9de29 100644
--- a/wfvm/win.nix
+++ b/wfvm/win.nix
@@ -6,7 +6,7 @@
, installCommands ? []
, users ? {}
# autounattend always installs index 1, so this default is backward-compatible
-, imageSelection ? "1"
+, imageSelection ? "Windows 10 Pro"
, efi ? true
, ...
}@attrs:
@@ -117,19 +117,9 @@ let
mkdir -p win/nix-win
7z x -y ${windowsIso} -owin
- # Extract desired variant from install.wim
- # This is useful if the install.wim contains multiple Windows
- # versions (e.g., Home, Pro, ..), because the autounattend file
- # will always select index 1. With this mechanism, a variant different
- # from the first one can be automatically selected.
- # imageSelection can be either an index (1-N) or the image name
- # wiminfo can list all images contained in a given WIM file
- wimexport win/sources/install.wim "${imageSelection}" win/sources/install_selected.wim
- rm win/sources/install.wim
-
# Split image so it fits in FAT32 partition
- wimsplit win/sources/install_selected.wim win/sources/install.swm 4096
- rm win/sources/install_selected.wim
+ wimsplit win/sources/install.wim win/sources/install.swm 4090
+ rm win/sources/install.wim
cp ${autounattend.autounattendXML} win/autounattend.xml