# Generalize a macOS image, offline from the PE: create the (admin) user on the # image's Data volume with dscl, auto-login, suppress the first-login Setup # Assistant, hostname, locale, timezone, use the whole disk, and give the image # a fresh SMBIOS identity (serial/MLB from macserial, MAC + UUID from `seed`) so # every generalized VM looks like a distinct Mac to Apple ID/iMessage. # Usage: (templates.generalize { username = "User"; password = ""; hostname = "MAC"; }) # delayOobeRun = true: no user, Setup Assistant runs on first real boot (like Windows OOBE) { pkgs, lib, ... }: { username ? "User", password ? "", fullName ? username, autoLogon ? true, hostname ? "MAC-VM", locale ? "en-US", timezone ? "UTC", delayOobeRun ? false, # SMBIOS identity; anything unset is generated model ? null, serial ? null, mlb ? null, uuid ? null, mac ? null, seed ? "${hostname}-${username}", # keep the user's home on an APFS volume labelled vmix-home (a virtio-blk disk # the host provides, formatted by the PE on first start). macOS refuses mounts # over /Users (firmlink), so the volume automounts at /Volumes/