vmix CLI, laptop images, SDL display

CLI (nix run .#):
- `vmix build` and `vmix copy` subcommands
- --image, --generalize key=val, --to-disk, --to-remote-disk
- SDL display auto-detected via DISPLAY temp file passthrough
- --print-build-logs for visible build progress
- -S 4k sparse writes for faster disk copy

Images:
- win10.laptop and win11.laptop bundles (no VirtIO, keeps defender/hibernation)
- templates.bundles.laptop shared template list
- win11 adds reg.disableUCPD on top

Build improvements:
- consistent === vmix: === log prefixes
- SDL display via /tmp/.vmix-display-$$ temp file

Env helpers:
- .env-export-vmix-cli-local: vmix alias for local flake

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Git Sagar 2026-05-23 21:56:51 -03:00
parent 94f299bb81
commit 015714f713
8 changed files with 250 additions and 53 deletions

View file

@ -62,6 +62,8 @@
cdromArgs = lib.concatMapStringsSep " \\\n " (cd: "-drive file=${cd},media=cdrom,readonly=on") cdroms;
displayArg = if vncDisplay != null then "-vnc ${vncDisplay}" else null;
auditBootCommands = lib.optionalString hasAuditScript ''
echo "=== vmix: injecting audit script (${name}) ==="
@ -77,9 +79,19 @@
cp ${pkgs.OVMF.fd}/FV/OVMF_VARS.fd vars.fd
chmod +w vars.fd
echo "=== vmix: booting Audit Mode for ${name} (VNC: ${if vncDisplay != null then vncDisplay else "disabled"}) ==="
VMIX_DISPLAY="-nographic"
${lib.optionalString (displayArg != null) ''VMIX_DISPLAY="${displayArg}"''}
${lib.optionalString (displayArg == null) ''
VMIX_DF=$(ls -t /tmp/.vmix-display-* 2>/dev/null | head -1)
if [ -n "$VMIX_DF" ]; then
export DISPLAY=$(cat "$VMIX_DF")
VMIX_DISPLAY="-display sdl"
fi
''}
echo "=== vmix: booting Audit Mode for ${name} ==="
timeout 1800 qemu-system-x86_64 \
${if vncDisplay != null then "-vnc ${vncDisplay}" else "-nographic"} \
$VMIX_DISPLAY \
-accel kvm \
-m ${toString memSize} \
-smp ${toString smp} \