Files
nixos-config/modules/wm/virtualisation/qemu.nix
2026-04-26 10:27:50 +02:00

43 lines
804 B
Nix

#
# Qemu/KVM with virt-manager
#
{
config,
pkgs,
user,
...
}: {
# Add libvirtd and kvm to userGroups
users.groups.libvirtd.members = ["root" "${user}"];
virtualisation = {
libvirtd = {
enable = true; # Virtual drivers
onShutdown = "shutdown";
#qemuPackage = pkgs.qemu_kvm; # Default
qemu = {
runAsRoot = false;
};
};
spiceUSBRedirection.enable = true; # USB passthrough
};
programs.dconf.enable = true;
environment = {
systemPackages = with pkgs; [
virt-manager
virt-viewer
qemu
OVMF
OVMF-cloud-hypervisor
gvfs # Used for shared folders between linux and windows
cloud-hypervisor
];
};
services = {
# Enable file sharing between OS
gvfs.enable = true;
};
}