I’ll just link this here: CUDA Cache for Nix Community.
All the mentioned hacks like LD_LIBRARY_PATH
(nix-ld
is the safer way to implement that), FHS namespaces, and temporary “patchelfed” shims such as torch-bin
are all viable ways to make PyPi software work. Be advised, however, that this is fundamentally different from and less reliable than actually using the “real” nixpkgs, which supports overlays and overrides and attempts to make packages complete and correct by construction.
It’s also maybe worth mentioning that the page was written long time ago and might (well, it does) contain outdated information.