{ config, pkgs, ... }:
{
  # See also: virt-manager.nix

  # View log since last boot:
  #   journalctl -b SYSLOG_IDENTIFIER=org.gnome.Boxes

  # Open issue: HiDPI support. https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/635

  users.users.yoda = {
    packages = with pkgs; [
      gnome.gnome-boxes # Virtual machines
    ];
  };

  # libvirt is a dependency of GNOME Boxes
  # https://nixos.wiki/wiki/Libvirt
  virtualisation.libvirtd.enable = true;
  users.users.yoda.extraGroups = [ "libvirtd" ];

  # Required for USB redirection to work, see
  #   https://github.com/NixOS/nixpkgs/issues/39129#issuecomment-382569032
  #   https://www.reddit.com/r/NixOS/comments/177wcyi/comment/k4vok4n/
  security.polkit.enable = true;
  virtualisation.spiceUSBRedirection.enable = true;
}
