NixOS-Config/nixos/services/virtualisation.nix
2024-08-24 22:16:51 -04:00

37 lines
665 B
Nix

{
config,
pkgs,
...
}: {
# Enable virtualization
virtualisation = {
libvirtd = {
enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
qemu = {
ovmf = {
enable = true;
packages = [pkgs.OVMFFull.fd];
};
swtpm.enable = true;
};
};
spiceUSBRedirection.enable = true;
};
# Install programs system-wide
environment.systemPackages = with pkgs; [
virt-manager
virtiofsd
dnsmasq
spice-vdagent
looking-glass-client
];
# Allow Looking-Glass permissions
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 jimbo libvirtd -"
];
}