Global: add IOMMU toggle to virualisation

This commit is contained in:
blahai 2024-11-22 21:51:14 +02:00
parent 12ef689a43
commit 233e4fe6a8
Signed by: blahai
SSH key fingerprint: SHA256:ZfCryi+V64yG+vC1ZIIsqgvBCmA31tTi7RJ6M8CvpRc

View file

@ -1,10 +1,12 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }:
boot = { let enableIOMMU = true;
initrd.kernelModules = lib.mkBefore [ in {
"kvm-amd" boot = lib.mkIf enableIOMMU {
"vfio_pci" initrd.kernelModules = lib.mkBefore [
"vfio_iommu_type1" "kvm-amd"
"vfio" "vfio_pci"
"vfio_iommu_type1"
"vfio"
]; ];
kernelParams = [ kernelParams = [
"amd_iommu=on" "amd_iommu=on"
@ -49,5 +51,4 @@
moonlight-qt # for linux vms moonlight-qt # for linux vms
looking-glass-client # for windows vms :husk: looking-glass-client # for windows vms :husk:
]; ];
} }