Fork me on GitHub
#leiningen
<
2022-09-13
>
Akiz07:09:52

Hi, I have a project.clj with :repl profile. I have also local :repl profile in ~/.lein/profile By default - :repl from project.clj get used. Is there any option to get these two profiles merged when starting the REPL so I can use both local and project profile?

eskos08:09:13

https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#composite-profiles maybe, although assumption is that the keys would be different. Generally if your project relies on stuff from your user profile, you should redefine the dependent parts in the project itself, as otherwise you’ll end up with a project definition that doesn’t work without your local state. It’s way less brittle to use the lein with-profile +mylocalprofile <task> form. https://bleu-barbeau.com/posts/2016-07-15-leiningen-profiles/ walks through using profiles pretty well.

Akiz08:09:19

@U8SFC8HLP Thank you, this might work. All important stuff is inside project.clj, but i also have local Reveal configuration that i want to use with that one particular project.

Akiz07:09:31

that seems to be unusable in my case. this is my ~/.lein/profiles.clj

{:repl {:dependencies [[vlaaad/reveal "1.3.276"]]
        :repl-options {:nrepl-middleware [vlaaad.reveal.nrepl/middleware]}
        :jvm-opts ["-Dvlaaad.reveal.prefs={:theme,:light}"]}}
this is my project profiles.clj
:repl {:prep-tasks   ["npm-deps" "deps"]
                    :repl-options {:init-ns user}
                    :dependencies [[hashp "0.2.1"]]
                    :injections   [(require 'hashp.core)]}

eskos08:09:22

Don’t use the same name for the profiles 🙂

eskos08:09:43

Alternatively if you’re just trying to avoid typing, > The :default profile specifies the profiles that are active by default when running lein tasks. If not overridden, this is set to :leiningen/default, which is a composite profile with [:base :system :user :provided :dev].