One of the solutions I was recommended (in telegram ru NixOS chat):
- Install quicklisp as per https://www.quicklisp.org/beta/#installation
as “dirty” part of the system - For the projects, use nix-shell
with lisp compiler (sbcl or another) and any non-lisp dependencies specified in nix - Lisp compiler would not automatically see dependencies from nix-shell
builtinputs
,
so in shell definition setting explicitlyLD_LIBRARY_PATH
and sometimesCPATH
for headers would be required
How to get external libraries, on example of loading CLOG
(ql:quickload :clog)
failed with error
0: (CFFI::FL-ERROR “Unable to load any of the alternatives:~% ~S” (“libcrypto.so.1.1” “libcrypto.so.1.0.0” “libcrypto.so.3” “libcrypto.so”))
1: (CFFI::TRY-FOREIGN-LIBRARY-ALTERNATIVES CL+SSL/CONFIG::LIBCRYPTO (“libcrypto.so.1.1” “libcrypto.so.1.0.0” “libcrypto.so.3” “libcrypto.so”) NIL)
I made shell
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.sbcl
# for koans
pkgs.inotify-tools
# for CLOG
pkgs.openssl
pkgs.sqlite
];
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath([pkgs.openssl])}:${pkgs.lib.makeLibraryPath([pkgs.sqlite])}
'';
};
(and adding them to buildInputs
is probably not even required?)
Then with direnv picking up new env vars, and sbcl restarted
(ql:quickload :clog)
finished without errors
As I understand this advice Tip for SBCL, Quicklisp, and Library Dependencies with pkg-config it’s written to pick up dependencies that are installed system-wide through nix, not a separate shell