37 lines
886 B
Nix
37 lines
886 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
|
|
gvfs # Used for shared folders between linux and windows
|
|
];
|
|
};
|
|
|
|
services = { # Enable file sharing between OS
|
|
gvfs.enable = true;
|
|
};
|
|
}
|