Add hub auto-launch: XDG autostart, API endpoints, and frontend toggle

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/0b0d70c0-01d1-49d1-b9ca-8d4f8e5af64a

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-07 01:26:11 +00:00
committed by GitHub
parent 27502c6997
commit 13e3b76c88
4 changed files with 134 additions and 0 deletions

View File

@@ -203,6 +203,30 @@ let
fi
'';
# ── Hub auto-launch wrapper script ────────────────────────────────
hub-autolaunch-script = pkgs.writeShellScript "sovran-hub-autolaunch.sh" ''
export PATH="${lib.makeBinPath [ pkgs.curl pkgs.xdg-utils ]}:$PATH"
DISABLE_FLAG="/var/lib/sovran/hub-autolaunch-disabled"
BOOT_FLAG="/run/sovran-hub-autolaunch-done"
# User disabled auto-launch via Hub toggle
[ -f "$DISABLE_FLAG" ] && exit 0
# Already launched this boot
[ -f "$BOOT_FLAG" ] && exit 0
touch "$BOOT_FLAG"
# Wait for Hub server to become ready (max ~15 seconds)
for i in $(seq 1 15); do
curl -s -o /dev/null -w "" http://localhost:8937 && break
sleep 1
done
xdg-open http://localhost:8937
'';
sovran-hub-web = pkgs.python3Packages.buildPythonApplication {
pname = "sovran-systemsos-hub-web";
version = "1.0.0";
@@ -313,5 +337,16 @@ in
networking.firewall.allowedTCPPorts = [ 3051 8937 60847 ];
# ── Auto-launch Hub in browser on login ───────────────────────
environment.etc."xdg/autostart/sovran-hub-autolaunch.desktop".text = ''
[Desktop Entry]
Type=Application
Name=Sovran Hub Auto-Launch
Exec=${hub-autolaunch-script}
Terminal=false
X-GNOME-Autostart-enabled=true
NoDisplay=true
'';
};
}