nix machine / user configurations
at terra 1.2 kB view raw
1{pkgs, ...}: { 2 environment.systemPackages = with pkgs; [ 3 virt-manager 4 virtiofsd 5 looking-glass-client 6 ]; 7 virtualisation = { 8 spiceUSBRedirection.enable = true; 9 libvirtd = { 10 enable = true; 11 # extraConfig = '' 12 # user="patriot" 13 # ''; 14 qemu = { 15 ovmf.enable = true; 16 # runAsRoot = true; 17 # Full is needed for TPM and secure boot emulation 18 ovmf.packages = [pkgs.OVMFFull.fd]; 19 swtpm.enable = true; 20 # verbatimConfig = '' 21 # namespaces = [] 22 # cgroup_device_acl = [ "/dev/vfio/9", "/dev/kvm", "/dev/null" ] 23 # user = "patriot" 24 # group = "libvirtd" 25 # ''; 26 }; 27 }; 28 vfio = { 29 enable = true; 30 IOMMUType = "amd"; 31 devices = [ 32 "10de:25a2" # GPU 33 ]; 34 blacklistNvidia = true; 35 ignoreMSRs = true; 36 disableEFIfb = false; 37 }; 38 kvmfr = { 39 enable = true; 40 devices = [ 41 { 42 dimensions = { 43 width = 1920; 44 height = 1080; 45 }; 46 permissions = { 47 user = "patriot"; 48 group = "kvm"; 49 mode = "0660"; 50 }; 51 } 52 ]; 53 }; 54 }; 55}