summaryrefslogtreecommitdiff
path: root/modules/passthrough.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/passthrough.nix')
-rw-r--r--modules/passthrough.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/passthrough.nix b/modules/passthrough.nix
new file mode 100644
index 0000000..23afa88
--- /dev/null
+++ b/modules/passthrough.nix
@@ -0,0 +1,25 @@
+{ pkgs, lib, config, ... }:
+let
+ # RTX 3070 Ti
+ gpuIDs = [
+ "10de:28e0" # Graphics
+ "10de:22be" # Audio
+ ];
+in {
+ boot = {
+ initrd.kernelModules = [
+ "vfio_pci"
+ "vfio"
+ "vfio_iommu_type1"
+
+ "nvidia"
+ "nvidia_modeset"
+ "nvidia_uvm"
+ "nvidia_drm"
+ ];
+
+ kernelParams = [
+ ("vfio-pci.ids=" + lib.concatStringsSep "," gpuIDs)
+ ];
+ };
+}