leiningen 2023-06-21

Is it possible to inject environment variables (from a file) in lein process? I am using Emacs and Cider. At the moment I have to type them manually to alter lein command. C-u M-x cider-jack-in-clj.

We use lein-environ. I didn’t know it can update env variables.

It doesn't exactly do that, it provides an interface for reading environmental variables with a set of overrides (which may be good enough for you, I'm not sure what you're trying to do). If you're trying to make sure those env vars are getting passed along to subprocesses that you're kicking off, you'll probably want to set them via https://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html.

I need to use a different AWS key for some projects. AWS client doesn’t use environ unfortunately.

I sense that https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html might help up to a point, that way, the bulk of the per-project stuff doesn't have to be dumped into larger files. Activating an aws profile on a per-dir basis should be easy with emacs.

👍 1