From c0e12934050a2ae2c3d3f075ac805500f2ab9fca Mon Sep 17 00:00:00 2001 From: Git Sagar Date: Thu, 10 Sep 2026 06:10:35 -0300 Subject: [PATCH] generalize: drop CopyProfile when relocating profiles, and name FolderLocations twice The data volume comes out correctly partitioned, formatted and labelled, and containing nothing but $RECYCLE.BIN and System Volume Information -- so the disk work lands and the relocation does not. Two candidates, both cheap to address together. CopyProfile is now dropped whenever profilesDirectory is set. Sysprep choosing a profile to copy into Default while the profile root is being moved is the likelier of the two, and a profile that persists is worth more than the Audit Mode customizations that CopyProfile preserves. FolderLocations is now named in oobeSystem as well as specialize. Which pass honours it is not something the documentation is crisp about, and saying it twice costs nothing. This matters more than it looks: with UWF protecting C: and the profile still on C:, every profile write lands in the overlay and is discarded on reboot, which makes the whole VM stateless. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_0117qMyjpuXsjpVAcpJbFD8g --- lib/images/windows/templates/generalize.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/images/windows/templates/generalize.nix b/lib/images/windows/templates/generalize.nix index 3b4d3fe..ed37374 100644 --- a/lib/images/windows/templates/generalize.nix +++ b/lib/images/windows/templates/generalize.nix @@ -247,11 +247,20 @@ in - + - true +${lib.optionalString (profilesDirectory == null) " true"} Automatic @@ -302,6 +311,7 @@ ${dataDiskXml} ${username} ${hostname} +${folderLocationsXml} ${timezone}