We currently use only environment variables to configure the "gn-guile" service. This is not a bad thing, per-se, but there are a few problems with the way we currently do it.
First, we use global variables for the configurations, which can lead to "action at a distance" kind of failures that can be difficult to debug. I propose having an explicit configuration system that follows a known precedence order for the various configurations.
The second issue is that the naming scheme for the environment variables does not clearly indicate what they do, e.g.
I propose getting rid of the environment variables for now, and using configuration files for the service configuration, and overriding values using the command-line arguments, at least for now.
The conventional precedence rules, from lowest to lowest precedence is:
I propose the introduction of the CLI arguments, and possibly HOME and CWD config files, via the "guile-config" library. The library does not (currently) support use of environment variable, so we can drop use of them for the time being.
Once the configurations have been read, they will be passed to the functions that need them as arguments. In this way, we get rid of the global configuration variables.
Down the road, should we need to re-introduce environment variables, I propose renaming the variables in the following pattern:
etc.
The new names are long, but also indicate the following: