Env var corresponding to 'iex -pa'?

Quoting man iex

     -pa directory
             Adds the specified directory to the beginning of the code path. If the
             directory already exists, it will be removed from its old position and
             put to the beginning.

             See also the function Code.prepend_path/1.

Is there an ENV variable corresponding to this?

The XY problem is:

  1. apparently ~/.iex.exs can not define + load module in same file, so I need *.beam file to be somewhere
  2. then I need to use iex -pa to ensure that iex can find this beam file
  3. now, I don’t want to always specify this, so I would prefer to stuff this in a ENV variable somewhere, i.e. the equiv of PATH, LD_LIBRARY_PATH or JAVA_HOME, …

Question: is there a ENV var that corresponds to iex -pa ?

ERL_LIBS or you can use ERL_FLAGS="-pa path".


I could not get ERL_LIBS to work, but ERL_FLAGS solved it for me. Thanks!