I’m trying to install libraries and binaries for a development environment that then builds a electron app. However, when running electron, even though gtk3 is installed in nix-shell, since electron was not installed with nix it can’t find the library.
EDIT: The electron version I need is not available in nixpkgs. It’s being installed impurely via package scripts.
What’s the best way to work around this or get this working?
I’m still getting node_modules/electron/dist/electron: error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory.
What should I set LD_LIBRARY_PATH to in this case? When I realize the mkShell derivation, I get the bash script that sets the envvars, but what I would want would be all the libraries in a single output, right?
Yeah, buildInputs will mostly just make the libraries available to ld (plus to pkg-config, when that is present). For runtime you will need to have something like LD_LIBRARY_PATH = "${gtk3}/lib" (or nicer LD_LIBRARY_PATH = lib.makeLibraryPath [ gtk3 ]). You can just pass the environment variable as an attribute to mkShell.