For projects generated with Mix, you can specify configuration variables in config/config.exs

use Mix.Config
config :redis, redis_url: "https://google.com"

In your code, you can retrieve this value like so:

Application.get_env(:redis, :redis_url)

If you have environment specific config files, use Mix.env:

use Mix.Config
import_config "#{Mix.env}.exs"

Additional reading: