2024-07-21 14:45:14 +00:00
|
|
|
# Running Interactive VMs with disko
|
|
|
|
|
2024-08-20 15:13:58 +00:00
|
|
|
disko now exports its own flavor of interactive VMs (similiar to config.system.build.vm).
|
2024-07-21 14:45:14 +00:00
|
|
|
Simply import the disko module and build the vm runner with:
|
|
|
|
```
|
|
|
|
nix build -L '.#nixosConfigurations.mymachine.config.system.build.vmWithDisko'
|
|
|
|
```
|
|
|
|
|
|
|
|
afterwards you can run the interactive VM with:
|
|
|
|
|
|
|
|
```
|
|
|
|
result/bin/disko-vm
|
|
|
|
```
|
|
|
|
|
2024-09-07 16:35:08 +00:00
|
|
|
You can configure the VM using the `virtualisation.vmVariantWithDisko` NixOS option:
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{
|
|
|
|
virtualisation.vmVariantWithDisko = {
|
|
|
|
virtualisation.fileSystems."/persist".neededForBoot = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-07-21 14:45:14 +00:00
|
|
|
extraConfig that is set in disko.tests.extraConfig is also applied to the interactive VMs.
|
|
|
|
imageSize of the VMs will be determined by the imageSize in the disk type in your disko config.
|
|
|
|
memorySize is set by disko.memSize
|