diff --git a/nixos/vms/config.nix b/nixos/vms/config.nix index 6be8a44..d851fa2 100644 --- a/nixos/vms/config.nix +++ b/nixos/vms/config.nix @@ -178,7 +178,7 @@ let ${optionalString vmCfg.vnc.enable "-vnc ${vncArgs}"} \ ${optionalString (vmCfg.spice.enable && vmCfg.spice.passwordFile != null) "-object secret,id=spice-pass-${vmCfg.name},file=${escapeShellArg vmCfg.spice.passwordFile}"} \ ${optionalString vmCfg.spice.enable "-spice addr=${vmCfg.spice.addr},port=${toString vmCfg.spice.port}${optionalString (vmCfg.spice.passwordFile == null) ",disable-ticketing=on"}${optionalString (vmCfg.spice.passwordFile != null) ",password-secret=spice-pass-${vmCfg.name}"}"} \ - ${optionalString vmCfg.spice.enable "-vga ${vmCfg.spice.displayDevice}"} \ + ${optionalString vmCfg.spice.enable (if vmCfg.spice.displayDevice == "qxl" && vmCfg.spice.vgamem != null then "-vga none -device qxl-vga,vgamem_mb=${toString vmCfg.spice.vgamem}" else "-vga ${vmCfg.spice.displayDevice}")} \ ${optionalString (vmCfg.spice.enable && vmCfg.spice.agent.enable) "-device virtio-serial-pci -chardev spicevmc,id=vdagent,debug=0,name=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0"} \ ${# Guest agent channel — prevents qemu-ga from spinning when virtio-win guest tools are installed optionalString isWindows "${optionalString (!vmCfg.spice.enable || !vmCfg.spice.agent.enable) "-device virtio-serial-pci"} -chardev socket,path=/tmp/qga-${vmCfg.name}.sock,server=on,wait=off,id=qga0 -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0"} \ diff --git a/nixos/vms/submoduleOptions.nix b/nixos/vms/submoduleOptions.nix index 5dcca25..e871ca1 100644 --- a/nixos/vms/submoduleOptions.nix +++ b/nixos/vms/submoduleOptions.nix @@ -97,6 +97,11 @@ with lib; default = "qxl"; description = "QEMU -vga type to use with SPICE (qxl, virtio, std, none)."; }; + vgamem = mkOption { + type = types.nullOr types.int; + default = null; + description = "Video memory in MB for QXL device. When set, uses -device qxl-vga instead of -vga qxl."; + }; }; nographic = mkOption { type = types.bool;