Fork me on GitHub
#cursive
<
2023-01-24
>
Jurko16:01:17

Hi, can someone help me with Clojure Deps in Cursive. How to change "config dir"?

{:version "1.11.1.1113"
 :config-files ["/usr/local/Cellar/[email protected]/1.11.1.1113/deps.edn" "/Users/jurko/.config/clojure/deps.edn" "deps.edn" ]
 :config-user "/Users/jurko/.config/clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/Cellar/[email protected]/1.11.1.1113"
 :config-dir "/Users/jurko/.config/clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}

Alex Miller (Clojure team)16:01:18

the config dir is determined from the following info (the "user" deps.edn): https://clojure.org/reference/deps_and_cli#deps_sources

Alex Miller (Clojure team)16:01:50

I suspect you have $XDG_CONFIG_HOME set

Alex Miller (Clojure team)16:01:18

so you can override by setting CLJ_CONFIG

Jurko16:01:31

I saw this, but haven't understand

Jurko16:01:40

Is it problem of Cursive or Clojure?

Alex Miller (Clojure team)16:01:03

that's an environment variable, so you'll want to export a new setting wherever you do things like that, in such a way that Cursive sees the effects of that

Alex Miller (Clojure team)16:01:05

Cursive can either use the clojure CLI or use an embedded library (tools.deps). In both cases, those use the described environment variables

Jurko16:01:23

as I understand clojure know what is "config-dir". Why Cursive can't see it?

Alex Miller (Clojure team)16:01:24

I don't understand, sorry

Alex Miller (Clojure team)16:01:58

from the original post, you said you wanted to change the config dir - you do that by setting environment variables

Jurko16:01:20

Result of clojure -Sdescribe is

:config-dir "/Users/jurko/.config/clojure"

Alex Miller (Clojure team)16:01:51

what problem are you seeing?

Jurko16:01:34

but for Cursive config dir is /Users/jurko/.clojure

Alex Miller (Clojure team)16:01:28

ok, I would guess that at the terminal, you have $XDG_CONFIG_HOME set, but that Cursive is not seeing that environment variable due to how it is configured or started

Alex Miller (Clojure team)16:01:55

you can check that by doing something like (System/getenv "XDG_CONFIG_HOME") at a repl in Cursive

👍 2
Alex Miller (Clojure team)16:01:48

so then the question is how to set environment variables in a way that Cursive sees them - I don't know the answer to that, but it probably depends on how you start it

Jurko17:01:54

Thank you.

Jurko17:01:35

Following @U064X3EF3 suggestion, I've check at local and remote repl:

Alex Miller (Clojure team)17:01:26

well in the remote case, you're checking the environment of the remote jvm, so not sure that's relevant

Jurko17:01:39

Remote does see variable, local - doesn't

dvingo18:01:47

you can set env vars in the run config

cfleming00:01:42

In Cursive, you can use Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps | Project Settings | Path to config directory