summaryrefslogtreecommitdiff
path: root/modules/virt/qemu.nix
blob: f755952897b480c5626295e658bb25d56077241b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  lib,
  config,
  pkgs,
  ...
}: let
  inherit (lib) mkIf;
  cfg = config.virt;
in {
  config = mkIf cfg.qemu {
    programs.virt-manager.enable = true;
    users.groups.kvm.members = [config.user];
    users.groups.libvirtd.members = [config.user];
    virtualisation.libvirtd.enable = true;
    virtualisation.spiceUSBRedirection.enable = true;

    environment.systemPackages = with pkgs; [
      qemu
    ];
  };
}