From dcae2c375f58018b1d0cd3090f3cc9bddef6c354 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Fri, 19 Jul 2024 21:51:39 +0000 Subject: [PATCH] system/sandbar: Add vfio for xHCI controller --- system/sandbar/boot-config.nix | 2 +- system/sandbar/default.nix | 1 + system/sandbar/vfio.nix | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 system/sandbar/vfio.nix diff --git a/system/sandbar/boot-config.nix b/system/sandbar/boot-config.nix index b1f10f6..a100cf0 100644 --- a/system/sandbar/boot-config.nix +++ b/system/sandbar/boot-config.nix @@ -3,7 +3,7 @@ { boot = { kernelPackages = pkgs.linuxPackages_latest; - kernelParams = [ "intel_iommu=on" ]; + tmp.cleanOnBoot = true; initrd.systemd.enable = true; diff --git a/system/sandbar/default.nix b/system/sandbar/default.nix index c35e22f..0ae663d 100644 --- a/system/sandbar/default.nix +++ b/system/sandbar/default.nix @@ -4,6 +4,7 @@ imports = [ ./boot-config.nix ./hardware-configuration.nix + ./vfio.nix ../../sets/secureBoot.nix ../../sets/sshd.nix ../../sets/workstation.nix diff --git a/system/sandbar/vfio.nix b/system/sandbar/vfio.nix new file mode 100644 index 0000000..67775ac --- /dev/null +++ b/system/sandbar/vfio.nix @@ -0,0 +1,17 @@ +{ ... }: + +{ + boot.kernelParams = [ + "intel_iommu=on" + "vfio-pci.ids=1b21:1242" + ]; + boot.initrd.kernelModules = [ + "vfio" + "vfio_pci" + "vfio_iommu_type1" + "iommufd" + ]; + services.udev.extraRules = '' + SUBSYSTEM=="vfio", MODE="660", GROUP="wheel" + ''; +}