Skip to content

Instantly share code, notes, and snippets.

@fstamour
Created April 18, 2019 01:14
Show Gist options
  • Save fstamour/36ed6d8f5198ae0e9429044d5fd1d94e to your computer and use it in GitHub Desktop.
Save fstamour/36ed6d8f5198ae0e9429044d5fd1d94e to your computer and use it in GitHub Desktop.
hacky way to work with libraries in lisp with nix
(require 'cl-ppcre)
(defpackage :cffi)
(defparameter cffi::*foreign-library-directories*
`(,(merge-pathnames ".nix-profile/lib/"
(user-homedir-pathname))
,@(loop for path in (cl-ppcre:all-matches-as-strings
"-L[-\\w/.]+"
(uiop:getenv "NIX_LDFLAGS"))
append (directory (subseq path 2)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment