OpenGL

From NixOS Wiki
Revision as of 02:04, 25 November 2020 by imported>Tbenst (OpenGL: init with basic info)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

OpenGL must break purity due to the need for hardware-specific linkage. Intel, AMD, and Nvidia will have different libraries for example. On NixOS, these libraries are mounted at

 /run/opengl-driver/lib

and

 /run/opengl-driver-32/lib

When a program is installed in your environment, these libraries should be found automatically. However, this is not the case in a `nix-shell`. To fix, add this line to your shell.nix:

 LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib";


Related

https://nixos.wiki/wiki/Nixpkgs_with_OpenGL_on_non-NixOS