What exactly does hardware.opengl.extraPackages influence?

I don’t understand what should be put into hardware.opengl.extraPackages and what into environment.systemPackages. This is regarding running a machine with Jellyfin.

Since OpenGL is not a binary which will just get more libraries in its execution environment and OpenGL is also not compiled during nixos-rebuild switch to get more compile-time dependencies how are packages from hardware.opengl.extraPackages added to what part of OpenGL?

Can I just put everything into environment.systemPackages?

The concrete packages this concerns are:

  • intel-media-sdk
  • intel-compute-runtime
  • intel-media-driver
  • intel-gpu-tools
  • intel-vaapi-driver
  • jellyfin-ffmpeg
  • vaapiIntel
  • vaapiVdpau
  • libvdpau-va-gl
  • intel-ocl
  • intel-compute-runtime

“opengl” is a big misnomer in Nixpkgs. What it actually stands for generally drivers of all sorts. There have been efforts to changing it but they’re only progressing slowly. I’ve been planning on fixing a few of these up for 24.05.

These packages will be added to the environment under /run/opengl-driver. Binaries relying on hardware acceleration have this path added to their rpath, so they load their drivers from here. Again a misnomer as it’s not just opengl. Have a look inside for yourself, it should be fairly obvious.


I see. But how can I decide which package goes where? Or can I just put everything into environment.systemPackages? I suppose the libraries will then be available to all executables, not just the ones relying on hardware acceleration?

If you put packages in systemPackages, their libraries won’t end up in /run/opengl-driver/lib. That’s what the option is for.

Outside of this one specific impurity, there is no such thing as a global library path. This is core to the way Nix works. Adding a library to systemPackages won’t do anything.

1 Like