{ 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 = builtins.filter (x: builtins.elem "wheel" config.users.users."${x}".extraGroups) (builtins.attrNames config.users.users); }