aboutsummaryrefslogtreecommitdiff
path: root/modules/profiles/libvirtd/default.nix
blob: fa617d12f232514aa4e353e540b00e972cead240 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ config, ... }:
{
  virtualisation.libvirtd = {
    enable = true;
    qemu = {
      ovmf.enable = true;
      runAsRoot = false;
    };
    onBoot = "ignore";
    onShutdown = "shutdown";
  };

  programs.virt-manager.enable = true;

  # Add any users in the 'wheel' group to the 'libvirtd' group.
  users.groups.libvirtd.members = let users = config.users.users; in
    builtins.attrNames users
    |> builtins.filter (
      x: builtins.elem "wheel" users.${x}.extraGroups
    );
}