Merge pull request #158327 from babbaj/virtio-keyboard-option

nixos/qemu-vm: Create option for virtio-keyboard device
This commit is contained in:
Robert Hensing 2022-02-06 16:37:00 +01:00 committed by GitHub
commit 189f73465b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -632,6 +632,15 @@ in
Enable the Qemu guest agent.
'';
};
virtioKeyboard =
mkOption {
type = types.bool;
default = true;
description = ''
Enable the virtio-keyboard device.
'';
};
};
virtualisation.useNixStoreImage =
@ -835,7 +844,9 @@ in
# FIXME: Consolidate this one day.
virtualisation.qemu.options = mkMerge [
[ "-device virtio-keyboard" ]
(mkIf cfg.qemu.virtioKeyboard [
"-device virtio-keyboard"
])
(mkIf pkgs.stdenv.hostPlatform.isx86 [
"-usb" "-device usb-tablet,bus=usb-bus.0"
])