nix-config/modules/virtualization/qemu.nix

43 lines
781 B
Nix
Raw Normal View History

2023-10-14 13:24:01 +02:00
{
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;
};
}