Demo Setup (Or What I did for W laptop)
To mount the nix store into the vm and have the ssh keys pre configured. I build custom nixos-installer images and pushed them to https://static.clan.lol/images
the code responsible for the custom images is here: https://git.clan.lol/clan/demo-nixos-image/src/branch/main/nix/image-installer/module.nix#L30
To reproduce execute:
./build-images
ssh root@clan.lol "rm /var/www/static.clan.lol/images/nixos-installer-x86_64-linux.iso"
rsync result/iso/nixos-installer-x86_64-linux.iso root@clan.lol:/var/www/static.clan.lol/images
Afterwards do:
nix-prefetch-url https://static.clan.lol/images/nixos-installer-x86_64-lin
ux.iso
and in ./flake.nix edit baseImageChecksum to the one nix-prefetch-url gave you.
then do a direnv reload.
The demo-start.sh script executes the kvm command which is a retrofitted python program that does virt-install do setup the vm.
The code responsible for it can be found here: https://github.com/Qubasa/vm-spawner/blob/japan_demo/vm_spawner/kvm/install.py#L119
Prequesits for the script to work is to have
virtualisation.libvirtd.enable = true;
virtualisation.libvirtd.qemu.vhostUserPackages = [ pkgs.virtiofsd ];
environment.systemPackages = with pkgs; [
virt-manager
];
set and having ssh access to root@localhost from your current user.
Then execute virt-manager
click on File -> Add Connection
click on Connect button.
Then right click on QEMU/KVM then go to Details -> Virtual Networks
and tick On Boot and click the Play button for the default network.
Demo Workflow
Execute ./demo-start.sh to start the demo.
Then follow the demo steps in https://outline.clan.lol/doc/japan-demo-JmWrN5Nnh1


