Java based emacs package ejc-sql expects write access to install directory, need workaround

Error:

error in process sentinel: Could not start nREPL server: java.io.IOException: Permission denied. Please check your access rights for /nix/store/ay75a41p8z50654qq9afaakmbj9wwpxi-emacs-packages-deps/share/emacs/site-lisp/elpa/ejc-sql-20200607.2010

As the author says:

nREPL needs to create .nrepl-port file

How do you go about installing and using an emacs package that expects to have write access to it’s install directory?

Relevant GitHub issue: Doesn't work on nixos · Issue #136 · kostafey/ejc-sql · GitHub

I got a chance to look at this again today and I got closer… now I’m unsure if there’s a remaining elisp error or an nrepl error.

I basically just said “nrepl use the /tmp” directory but that broke something else, see: https://github.com/codygman/hci/commit/ddd9cf8dbb9c5659f54f3e32db84dac9fd30df5e#diff-6368190673f1bdd962cb26e3712b49eeR922

That’s generally the solution – you have to change the directory to something writeable outside the nix store,

If the port-file is something that can be prebuilt, you can also pre-generate it also.