diff --git a/lib/build-vms.nix b/lib/build-vms.nix index 913d5276db2c..f151060344e8 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -76,7 +76,7 @@ rec { "${config.networking.hostName}\n")); virtualisation.qemu.options = - lib.flip lib.concatMapStrings interfacesNumbered + lib.flip map interfacesNumbered ({ first, second }: qemuNICFlags second first m.second); }; } diff --git a/lib/qemu-flags.nix b/lib/qemu-flags.nix index 5d8e898c534c..de355b08918c 100644 --- a/lib/qemu-flags.nix +++ b/lib/qemu-flags.nix @@ -3,7 +3,8 @@ { qemuNICFlags = nic: net: machine: - "-net nic,vlan=${toString nic},macaddr=52:54:00:12:${toString net}:${toString machine},model=virtio " + - "-net vde,vlan=${toString nic},sock=$QEMU_VDE_SOCKET_${toString net} "; + [ "-net nic,vlan=${toString nic},macaddr=52:54:00:12:${toString net}:${toString machine},model=virtio" + "-net vde,vlan=${toString nic},sock=$QEMU_VDE_SOCKET_${toString net}" + ]; } diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 91aeb950a156..4b29f38b4207 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -109,8 +109,8 @@ let virtualisation.qemu.options = mkOption { - default = ""; - example = "-vga std"; + default = []; + example = [ "-vga std" ]; description = "Options passed to QEMU."; }; @@ -173,8 +173,8 @@ let -append "$(cat ${config.system.build.toplevel}/kernel-params) init=${config.system.build.toplevel}/init regInfo=${regInfo} ${kernelConsole} $QEMU_KERNEL_PARAMS" \ ''} \ ${qemuGraphics} \ - $QEMU_OPTS \ - ${config.virtualisation.qemu.options} + ${toString config.virtualisation.qemu.options} \ + $QEMU_OPTS ''; @@ -297,6 +297,8 @@ in ''; virtualisation.pathsInNixDB = [ config.system.build.toplevel ]; + + virtualisation.qemu.options = [ "-usbdevice tablet" ]; # Mount the host filesystem via CIFS, and bind-mount the Nix store # of the host into our own filesystem. We use mkOverride to allow