Whether you use functions or macros should matter too much in the end, but if what you're looking for is the "keeping it in one place" part, I'd suggest putting it in its own namespace/module
defmodule MyApp.Configuration
def server_name do
"foo"
end
# or if you prefer having it all on one line
def host_name, do: "example.com"
# for complete equivalency, you can use a macro
defmacro other_config do
"some value"
end
end
and then in your app, instead of including the file, you can alias the module so have a short prefix to indicate it's configuration, and indicate they come from elsewhere
defmodule MyApp.Server do
alias MyApp.Configuration, as: C
end
or if you want to use the names directly
defmodule MyApp.Server do
import MyApp.Configuration
end