However, when I’m deploying it to a server, the error occurs stating that:
warning: variable "some_var" does not exist and is being expanded to "some_var()", please use parentheses to remove the ambiguity or change the variable name
config/prod.exs:4
** (Mix.Config.LoadError) could not load config config/prod.exs
** (CompileError) config/prod.exs:4: undefined function some_var/0
No they aren’t included in that sense that it usually would mean in C or PHP, they are loaded, evaluated and merged into the current config.
Thus, if you want to have some piece of config common in multiple environments, just configure it in config.exs, and overwrite it everywhere where you do need it defferently.
In fact sometimes it would be useful to be able to access previous config values in further configs. For example with Nerves, I ran into a situation where I was setting a list in the configuration and a further config would have added to that list. Copying the whole list to the second place makes it worse to maintain.
Thinking more about it, it should be possible to use System.put_env/1/2 in the config.exs and System.get_env/0/1 in the ${MIX_ENV}.exs to circumvent the limitation.
As I see your use case here is an idea. Untested and maybe syntactically wrong.
It seems the only thing that needs configured is some_var = "my_var". The rest of the keys are derived from it. My guess is that there must be some default value for it since you seek to use your own config file. Based on that you can create a module that provides the calculated values and use the functions instead of variables.