nix-config/modules/virtualization/qemu.nix

42 lines
781 B
Nix

{
config,
pkgs,
vars,
...
}: {
boot.extraModprobeConfig = ''
options kvm_intel nested=1
'';
users.groups.libvirtd.members = ["root" "${vars.user}"];
virtualisation = {
libvirtd = {
enable = true;
qemu = {
verbatimConfig = ''
nvram = [ "${pkgs.OVMF}/FV/OVMF.fd:${pkgs.OVMF}/FV/OVMF_VARS.fd" ]
'';
swtpm.enable = true;
};
};
spiceUSBRedirection.enable = true;
};
environment = {
systemPackages = with pkgs; [
virt-manager # VM Interface
virt-viewer # Remote VM
qemu # Virtualizer
OVMF # UEFI Firmware
gvfs # Shared Directory
swtpm # TPM
virglrenderer # Virtual OpenGL
];
};
services = {
# File Sharing
gvfs.enable = true;
};
}