I have an example here: nixos/nvidia: add vaapi support by jonringer · Pull Request #162660 · NixOS/nixpkgs · GitHub
You just need to package the drivers (probably not trivial), and then just add them to hardware.opengl.extraPackages. This will mount them at /run/opengl-driver/, so your applications just need to add /run/opengl-driver/lib to their RUNPATH. You can use addOpenGLRunpath hook for ELF’s. Or you can export LD_LIBRARY_PATH=run/opengl-driver/lib before launching your application on NixOS.