Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1diff --git a/src/pyload/core/__init__.py b/src/pyload/core/__init__.py
2index 4324fc700..5d915a85e 100644
3--- a/src/pyload/core/__init__.py
4+++ b/src/pyload/core/__init__.py
5@@ -128,6 +128,13 @@ class Core:
6 else:
7 self._debug = max(0, int(debug))
8
9+ # Allow setting any option declaratively, for the NixOS module
10+ for env, value in os.environ.items():
11+ if not env.startswith("PYLOAD__"):
12+ continue
13+ section, opt = env.removeprefix("PYLOAD__").lower().split("__")
14+ self.config.set(section, opt, value)
15+
16 # If no argument set, read storage dir from config file,
17 # otherwise save setting to config dir
18 if storagedir is None: