pci passthrough
This commit is contained in:
26
nix/modules/pci-passthrough.nix
Normal file
26
nix/modules/pci-passthrough.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
let
|
||||
gpuIDs = [
|
||||
"10de:2704" # Graphics
|
||||
"10de:22bb" # Audio
|
||||
];
|
||||
in { pkgs, lib, config, ... }: {
|
||||
boot = {
|
||||
initrd.kernelModules = [
|
||||
"vfio_pci"
|
||||
"vfio"
|
||||
"vfio_iommu_type1"
|
||||
"vfio_virqfd"
|
||||
|
||||
# "nvidia"
|
||||
# "nvidia_modeset"
|
||||
# "nvidia_uvm"
|
||||
# "nvidia_drm"
|
||||
];
|
||||
|
||||
kernelParams = [
|
||||
"intel_iommu=on"
|
||||
] ++ lib.optional cfg.enable
|
||||
# isolate the GPU
|
||||
("vfio-pci.ids=" + lib.concatStringsSep "," gpuIDs);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user