wip: Add settings for the things that used to be env-vars
broken since the settings don't seem to be applying properly.
@lheckemann
So what's happening currently is, I think:
- Nix reads config files
- Plugins setting is loaded
- nix-otel settings are loaded and not recognised
- Plugin is loaded by initPlugins()
- nix-otel plugin is loaded
- [with the change I've made] OtelConfig is instantiated
- GlobalConfig::Register is instantiated, registering settings
- PluginInstance is instantiated, initialising the plugin
- initPlugins reapplies unknown settings, leading to the settings being actually set
- nix-otel plugin is loaded
IOW, the instantiation of the plugin happens before the settings are available. We need a way to pass the parameters into the Rust side after initialisation -- and a way to deal with them not being available yet...
I'm extremely unfamiliar with Rust/C++ FFI. Additionally, I'm not sure there's any way in which Nix communicates to a plugin that settings are fully loaded, so we might even need to add a hook inside Nix for that :/
And as if that weren't already enough Fun, I think I've discovered a bug in Nix's settings handling as far as plugins and command-line options are given. Usually, command-line settings like --option otel-otlp-endpoint foo override settings in nix.conf. But apparently, they don't for settings defined by plugins!?
Maybe we should stick with environment variables.