add new app for systemd monitoring

This commit is contained in:
2026-03-30 21:31:36 -05:00
parent 51c3e5969d
commit 3ce192bef7
8 changed files with 457 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
"""Load the Nix-generated config for Sovran_SystemsOS_Hub."""
import json
import os
def load_config() -> dict:
"""Read config from the path injected by the Nix derivation."""
path = os.environ.get(
"SOVRAN_HUB_CONFIG",
os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
"config.json",
),
)
try:
with open(path, "r") as fh:
return json.load(fh)
except (FileNotFoundError, json.JSONDecodeError):
return {"refresh_interval": 5, "command_method": "systemctl", "services": []}