Fork me on GitHub

Something that slightly surprises me: extra-paths specified in ~/.clojure/deps.edn aren't relative to ~/.clojure/deps.edn but the CWD. I suppose that's because it's directly merged rather than considered as its own source? I'm interested in doing this so that I can load a .clj file from ~/.clojure/... which loads a few common dev helpers for all projects I might work on (e.g.


Here's what I tried:

  {:extra-deps {com.gfredericks/dot-slash-2 {:mvn/version "0.1.5"}
		vvvvalvalval/scope-capture {:mvn/version "0.3.3"}}
   :jvm-opts ["-XX:-OmitStackTraceInFastThrow"]
   :extra-paths ["mydev"]
   :main-opts ["-i" "@mydev.clj"]}}}

Alex Miller (Clojure team)20:01:13

:paths and :extra-paths are relative to the location of the project deps.edn, and yes, all deps sources are merged prior to resolution

Alex Miller (Clojure team)20:01:52

you could instead use an alias that had :extra-deps to a local project root


That local root is still relative to the project deps.edn in my tests

Alex Miller (Clojure team)20:01:43

it is, but could also be absolute to anywhere

Alex Miller (Clojure team)20:01:01

there is no provided mechanism for making paths relative to the config directory

Alex Miller (Clojure team)20:01:13

(and I don't expect to add one)

Alex Miller (Clojure team)20:01:49

another approach is to put it in a git repo

☝️ 2

Use the absolute path?


That's a shame. I don't want to use an absolute path so the same thing works on all of the machines I work from.


I was going to test if there might be a solution around the`$XDG_CONFIG_DIR` variable. But it looks like even a plain absolute path is not going to work for you.

 {:path-test {:extra-paths ["/home/sky/.config/clojure/src"]}}}
$ clj -M:path-test
WARNING: Use of :paths external to the project has been deprecated, please remove: /home/sky/.config/clojure/src
Clojure 1.11.1

dominicm00:01:28 Filter and smudge might be the way to go