{ lib, modulesPath, numbers, ... }: with lib; let makeNic = host: iface: let { matchMac, iface, media, ... } = numbers.api.hostIface host iface; in if media != "eth" then [] else [ "-nic bridge,id=${iface},br=${iface},model=virtio,mac=${matchMac}" ]; makeNics = host: concatMap (makeNic host) (numbers.api.hostIfaces host); makeQemuNetworkingOptions = host: (makeNics host) ++ [ "-net nic,netdev=user.0,model=virtio" "-netdev user,id=user.0,\${QEMU_NET_OPTS:+,$QEMU_NET_OPTS}" ]; in { imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ./server.nix ]; config = { virtualisation.graphics = false; virtualisation.qemu.networkingOptions = makeQemuNetworkingOptions config.networking.hostName; }; }