vmix.nix/nixos/vms
Git Sagar c40f4460e3 vms: disks.os.persistMode (copy|backing) + a GC-root for the backing chain
persistMode=backing seeds the persistent OS disk as a thin qcow2 overlay
(`qemu-img create -b <storeImage>`) instead of a full cp, so many VMs share one
base image and each holds only its deltas. Because the overlay reads through a
store path that nix does not otherwise pin (the disk lives outside the store),
and because even a cp'd Windows disk backs onto the store chain, a per-VM
oneshot `vm.vmix-gcroot@<name>` reads the overlay's ACTUAL backing_file at boot
(not the config's current image, which drifts after a rebuild) and symlinks it
under /nix/var/nix/gcroots. It runs before the VM service and outside its
ProtectSystem sandbox. Fires whenever the OS disk is persistent, covering copy
too. Default stays copy, so existing VMs are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117qMyjpuXsjpVAcpJbFD8g
2026-09-16 12:23:45 -03:00
..
config.nix vms: disks.os.persistMode (copy|backing) + a GC-root for the backing chain 2026-09-16 12:23:45 -03:00
default.nix sync with labv2.nix + standalone flake with toDisk app 2026-05-23 19:18:10 -03:00
submoduleOptions.nix vms: disks.os.persistMode (copy|backing) + a GC-root for the backing chain 2026-09-16 12:23:45 -03:00