What is the proper way to pass arguments to a dependent application?

Hi,
Well It depends on the generation time of the config.

  • If you can define the config options at compile time , you can put them in config.exs of the final application using config :x, key: value[to set] and Application.get_env(:x, :key) [to fetch]. See also the remark at the and
  • if the config state is only known at startup time you could use [Application.start/2] (http://elixir-lang.org/docs/stable/elixir/Application.html#module-application-module-callback) and start the application using Supervisor. EDIT: See following reply
  • If You need runtime config, or multiple applications using X with startup time config then creating an Agent is the way to go

See also this question for a related problem I had a while ago, regarding the non-usability of config.exs from dependent packages.