This commit is contained in:
Jermeiah S 2025-07-10 01:25:45 -04:00
commit dc5069e9b2
No known key found for this signature in database
7 changed files with 323 additions and 0 deletions

40
microvm.nix Normal file
View file

@ -0,0 +1,40 @@
_: {
microvm = {
interfaces = [
{
type = "user";
# interface name on the host
id = "vm-a1";
# Ethernet address of the MicroVM's interface, not the host's
#
# Locally administered have one of 2/6/A/E in the second nibble.
mac = "02:00:00:00:00:01";
}
];
volumes = [
{
mountPoint = "/var";
image = "var.img";
size = 256;
}
];
shares = [
{
# use proto = "virtiofs" for MicroVMs that are started by systemd
proto = "9p";
tag = "ro-store";
# a host's /nix/store will be picked up so that no
# squashfs/erofs will be built for it.
source = "/nix/store";
mountPoint = "/nix/.ro-store";
}
];
# "qemu" has 9p built-in!
hypervisor = "qemu";
socket = "control.socket";
};
}