Fork me on GitHub
#cider
<
2022-08-26
>
mbarillier00:08:02

I'm looking for docs on setting up a clojure dev environment in a docker container on a remote host, and being able to access it from my local box. I've currently got an nrepl running in the container with the port exposed so I can connect my local emacs to it using cider-connect (specifying the remote box and exposed port). the source is mounted in the docker container using --mount so I can use tramp to edit the source on the remote box and have the changes visible inside the docker container. if I'm editing source in /ssh:remote:/path/to/src/foo.clj, how do I tell cider to send the expressions to the remote cider repl session? if there's a better/easier way I'd like to hear about it, this seems like it's kinda convoluted. I just want to be able to connect to a remote repl, edit code on the remote host, and evaluate forms remotely .... surely someone has figured out how to do this ... maybe?

mbarillier01:08:48

got it sorted: running cider-connect from the source dir links the two. also: https://docs.cider.mx/cider/usage/managing_connections.html#context-links

sw1nn11:08:42

wrt cider use-package .dir-locals.el cider-clojure-cli-aliases and lazy loading (maybe not really a cider issue per se) What is the correct way to set this up? I noticed that sometimes when emacs loads .dir-locals.el it complains about cider-clojure-cli-aliases not being safe, but the defcustom for that var specifies a :safe? 'stringp predicate so it shouldn't warn on a value like ":dev" Investigating this I notice that because of the lazy loading, when I open a clojure file, emacs hasn't yet loaded cider, doesn't (yet) know about cider-clojure-cli-aliases and thus assumes it's unsafe. Once cider is loaded, if I then (somehow) retrigger the loading of .dir-locals.elit will then load successfully without warning about safety. I tried different values for the mode in the CAR of the .dir-locals.el list but to no avail. I suspect what is required is use-package supporting some sort of auto/pre-load for customizable vars (like it does for commands with :commands), but I wonder if there is something I am missing? To be clear if I eager load clojure and cider mode all works well. For reference here is my .dir-locals.el

((clojure-mode . ((cider-clojure-cli-aliases . ":sw1nn/dev:aws/sso:integrant/repl"))))