pci passthrough

This commit is contained in:
2025-02-15 10:41:27 -07:00
parent fc8fd8245f
commit 2b80993ef7
2 changed files with 27 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
[
<home-manager/nixos>
./modules/k3s.nix
./modules/pci-passthrough.nix
];
# Bootloader.

View 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);
};
}