hauleth
Currently default Umbrella applications contains
import_config "apps/*/config/config.exs
In their root configuration file. My general question is why though? IMHO it provides only confusion and can lead to ugly bugs when order in which the “nested” configuration files will be imported will change (I haven’t seen any order guarantees in documentation of either import_config/1, Path.wildcard/1, nor filelib:wildcard/1). What I am proposing instead is that we should encourage having only one config/ directory in root of the umbrella.
Additionally for configuring current application we should encourage users to use :env option of application specification instead of global configuration file.
Trending in Discussions
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
Hi there! :wave:
@frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Lately I’ve been thinking about how to organize components as a LiveView application grows. One of the pain points I’ve found (for myself...
New
What IDE or editor are you using for Elixir development?
Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hubertlepicki
I do precise opposite. In
apps/*/config.exsI only have:and only have one instance of
dev.exs,test.exsandprod.exsper whole project, instead of splitting this among multiple files.It’s easier when the project becomes big to have the configuration consolidated in my opinion.
nsweeting
I prefer to keep app-specific config within their own directories. If I find that there is config that is common across multiple apps (ie. logger stuff), I will usually just create a new “logging” app that deals with all things logging. All the other apps then just add it as a dependency.
hauleth
I delete these files at all, as
apps/*/mix.exsalready containconfig_path: "../../config/config.exs"so all you need to do is to removeimport_config "apps/*/config/config.exs"from root configuration and call it a day.hubertlepicki
Yep, you can do that and it’s probably good for 99.9% of the cases. Leaving the files in allows you to handle the situation where app was started on it’s own, without other apps being started and give you the possibility to add some config option to handle that situation, but as I said it’s very rarely needed and your solution is good.
dimitarvp
IMO the defaults clearly send the message of “have the bare minimum global configuration in the umbrella’s root config and put everything else in app-specific configs”. F.ex. the company’s brand name would go to the root config and be fetched from there instead of being copy-pasted in plain text in templates.
Perhaps the problem is that your current use case is not the same as this seemingly intended default?
hauleth
But then it becomes more intense, ex. where should go logger configuration. Ok that is pretty simple, this is global configuration, so probably in root. But what when you are configuring metrics gathering? It should go to the top level or into application level? TBH I am more and more sure that configuration should be only global, and when you need to configure your application then you should put as much as possible configuration into
compiler.appspecs, so instead of having solution proposed by the Phoenix with:load_from_envset totrueinconfig/prod.exsinstead it should be:And then you can disable it in per-environment configuration. And
apps/*/configdirectories should not exist at all, only global configuration. That would also encourage people to havesys.configas small as possible instead having enormous amount of cruft (often needed only in compile-time) there.nsweeting
As mentioned above, you eliminate the need for all “global configuration”, which IMO, is less than ideal (ignoring the fact that mix config is global anyways
), by simply creating apps for those “global requirements” - ie. logging and metrics. My umbrella apps usually include both a logging and metrics app. These apps will do all the setup required for their domain. Any app that requires logging or metrics simply has to add
[{:logging, in_umbrella: true}, {:metrics, in_umbrella: true}]to their deps. If your requirements for logging or metrics ever expand - you have an easy point in which to work on it. This becomes more pronounced if you ever need to add “sinks” for either logging or metrics that require runtime config. Having an app for these makes it very clear where that code would go.Keeps things focused. Works for me. Might not for others…
hauleth
But are you aware, that adding dependency has nothing to do with configuration? Configuration of the dependencies is always ignored (unless you use your own wrapper over
Loggerinlogging, then maybe, butLoggerapplication is still global). So this approach is even more confusing.nsweeting
Not exactly true. If I have a logging app that uses an external service, and it requires runtime config, adding it as a dependency ensures that that app is started and configured before any app that depends on it.
I’d also argue that in many ways, this approach can be seen as more simple. If you open up an umbrella app, and need to change something to do with logging - where would you go first? The global config? The per app config? Or the app named
logging. In my mind - thats pretty clear.hauleth
TBH, I would go straight to global config, because you cannot configure
Loggerper application, both Erlang’sloggerand Elixir’sLoggerare global. I would somewhat agree if we would talk aboutmetricsapplication, butloggingfor me is misleading.