Fri Dec 1 15:20:11 EST 2017
So pretty much I will need to wrap an RPC call into a Debian
lxc-create can instantiate a VM in about 3 minutes if debs are cached
and the container is created on a ram disk.
lxc-create from cache takes only a couple of seconds.
to wrap this in a nix expression, a tar of the VM should probably be
stored in the nix store as produced by another platform.
Transferring these archives isn't even much of a big deal if they run
in ramdisk on the target host. So basically:
1. Nix machine calls a "debian factory" to create a VM image, and archives it in its store
2. Nix machine pushes this image to run it under a unique name on an lxc host, and gets a root SSH key
3. Nix machine calls into the VM to create a build product
4. Target VM is removed
All of this doesn't even need nix. It can be done using just make.
It's the idea.