main: Run registerGlobalConfig before loading config

This is a bit of a trip.

Commit 63b0a01d75 moved config
initialization out of static initializers.

In doing so, an oversight was made with the new
`GlobalConfig::registerGlobalConfig` calls. Previously all global
configuration would be handled well before `loadConfFile` was called.

The change placed `registerGlobalConfig` in `main` *after*
`initNix`. The `initNix` function is what calls `initLibStore`, which in
turn callse `loadConfFile`.

So, in effect, the configuration for `daemonAuthorizationSettings` and
`nixDevelopSettings` are not actually loaded.

Change-Id: I10dba2c98e032f910942ee0e0ca6bb39ef60edc2
This commit is contained in:
Samuel Dionne-Riel
2026-06-27 18:37:27 +00:00
committed by Samuel Dionne-Riel (work)
parent fce63f6dbf
commit fc6772a7dd
+3 -3
View File
@@ -458,12 +458,12 @@ int mainWrapped(AsyncIoRoot & aio, int argc, char ** argv)
return 0;
}
initNix();
initLibExpr();
GlobalConfig::registerGlobalConfig(daemonAuthorizationSettings);
GlobalConfig::registerGlobalConfig(nixDevelopSettings);
initNix();
initLibExpr();
#if __linux__
if (getuid() == 0) {
try {