30 lines
624 B
Nix
30 lines
624 B
Nix
|
{ lib, config, machine, hypervisorConfig, ... }: {
|
||
|
imports = [ ./shared.nix ];
|
||
|
|
||
|
options.lab.vmMacAddress = lib.mkOption {
|
||
|
type = lib.types.str;
|
||
|
description = ''
|
||
|
The MAC address of the VM's main NIC.
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
config = {
|
||
|
system.stateVersion = hypervisorConfig.system.stateVersion;
|
||
|
|
||
|
microvm = {
|
||
|
shares = [{
|
||
|
source = "/nix/store";
|
||
|
mountPoint = "/nix/.ro-store";
|
||
|
tag = "ro-store";
|
||
|
proto = "virtiofs";
|
||
|
}];
|
||
|
|
||
|
interfaces = [{
|
||
|
type = "tap";
|
||
|
id = "vm-${machine.hostName}";
|
||
|
mac = config.lab.vmMacAddress;
|
||
|
}];
|
||
|
};
|
||
|
};
|
||
|
}
|