Hello, I am SpiderUnderYourBed, I will go over how i got dynamic VFIO working on Nixos, first of all, what is dynamic VFIO? Dynamic VFIO is when you dynamically unload/load VFIO drivers for nixos? if you dont know what VFIO is, there are many great tutorials/explanations online, but in summery when someone is talking about VFIO they are referring to GPU passthrough. Now that we got all the definitions out of the way, I will share my flake and dive into each component, keep in mind your milage may vary, so i recommend going to the VFIO discord server or Reddit page
(this tutorial is also avalible on my website, spidershomelab.xyz)
My flake:
{ pkgs, lib, ... }:
let
#script = pkgs.writeScriptBin "KWIN_DRM_DEVICES.sh" ''
# realpath /dev/dri/by-path/pci-0000\:00\:02.0-card