Given I installed an Emacs package with Nix (e.g.
emacs28Packages.pdf-tools), how set an Emacs Lisp variable (e.g.
pdf-info-epdfinfo-program) pointing to the executable (e.g.
/nix/store/mx3rg8a3f9zqw0clqgb3y466wvyr8qnv-emacs-pdf-tools-20220214.344/share/emacs/site-lisp/elpa/pdf-tools-20220214.344/epdfinfo) if the package doesn’t link the binary to
bin or make it available in
$PATH in another way? When it is in
$PATH, I use the
(file-truename (executable-find executable-name)) to find it’s actual path in /nix/store and set it.
Besides epdfinfo, I also have this issue emacsql-sqlite (
You have a few different options:
- have home-manager write out a file in a known path (in my case
$XDG_CONFIG_HOME/doom/home-manager.el) that does the
setq bits for the various binaries. Then load it from your config.
- alternatively, create a wrapper for launching emacs that injects the various binaries into the path and the various emacs components will then auto-detect the binaries since they are on the $PATH.
There was this in earlier thread, I’ll try once back at my machine: How can I get Emacs pdf-tools working? - #7 by JonathanReeve
@peterhoeg @payas thank you both very much, both solutions worked!
(Unfortunately it doesn’t seem to be possible to mark both replies as solutions)
I nominate @peterhoeg 's solution as it applies non-doom configs as well.