Skip to content

Commit

Permalink
Merge pull request NixOS#158327 from babbaj/virtio-keyboard-option
Browse files Browse the repository at this point in the history
nixos/qemu-vm: Create option for virtio-keyboard device
  • Loading branch information
roberth authored Feb 6, 2022
2 parents 788ad76 + 56109be commit 189f734
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion nixos/modules/virtualisation/qemu-vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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"
])
Expand Down

0 comments on commit 189f734

Please sign in to comment.