summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-03-11 21:05:53 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2024-03-11 21:05:53 +0530
commitb71f27a2179cdfa58492e2696246d3d8e55f9844 (patch)
tree7a86e0e83e8e9a989115a6bc05d5899389eaac53
parent44861481073bc3cdad0a5c7794c77f60e42d5ba1 (diff)
update
-rw-r--r--machines/x/configuration.nix5
-rw-r--r--modules/passthrough.nix25
2 files changed, 28 insertions, 2 deletions
diff --git a/machines/x/configuration.nix b/machines/x/configuration.nix
index 62c119e..f3e60e4 100644
--- a/machines/x/configuration.nix
+++ b/machines/x/configuration.nix
@@ -9,6 +9,7 @@
"amdgpu.nix"
"amd.nix"
"nvidia.nix"
+ "passthrough.nix"
"core/audio.nix"
"core/bluetooth.nix"
"core/fonts.nix"
@@ -34,8 +35,8 @@
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
- }
- }
+ };
+ };
networking.hostName = "x";
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)
+ ];
+ };
+}