The default output of libjpeg-turbo in this nixpkgs is the tools (-bin), which has no lib/ at all, so the check failed with 'cannot load libjpeg-turbo from .../-bin/lib/libturbojpeg.so'. lib.getLib selects the output that actually holds the shared library.