A couple ways come to mind with varying levels of sophistication. The simplest is to just have each user define a ~/.myall.clj
in their home directory and then the start of the program would include a line:
(def per-user-config (load-file "~/.myall.clj"))
load-file
reads a file and returns the last form read in the file. This allows you to compose config files nicely. For instance you can make a company wide template that has symbols for things like user-name
and then load it from a per-user config file that defines user-name and then calls load-file
on the template
config-template.clj:
{:app-name "foo"
:user-url (str "http://server.company:8080/users/" user-name)
:foo "bar"}
joes-config.clj:
(def user-name "joe")
(load-file "resources/global-config.clj")
this allows you to distribute most of the config through git while still allowing users to overwrite any arbitrary part of the config.