setup siblix on buzz working

This commit is contained in:
ari committed 2026-10-27 09:56:57 -04:00
1 parent 2e8529fff0
commit 0efbc5817b
8 files changed
+60 -8

No files matched your search

-1
View File
@@ -31,7 +31,6 @@ in
hostAccess = [
{ port = ports.ollama; }
{ port = ports.ds4; }
# Primary skyg-linux-tracker on this host (it consolidates the lab).
{ port = ports.tracker; }
];
lanAccess = [
+6 -1
View File
@@ -26,7 +26,12 @@ in
hostAccess = [
{ port = ports.ollama; }
];
lanAccess = [ ];
lanAccess = [
{ address = "10.0.101.3"; port = 443; }
{ address = "10.0.101.3"; port = 3000; }
{ address = "10.0.101.3"; port = 8080; }
{ address = "10.0.101.3"; port = 9102; }
];
};
# A Hermes agent in every robot.
+45 -1
View File
@@ -1,10 +1,12 @@
# sibli is ephemeral: root resets to this config on every start, so change
# things here (then rebuild the host), not inside the robot.
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
let
# The robot's own nixpkgs has no host overlay, so build it from the repo.
# Fine for the seed build; a rebuild inside the robot can't see this path.
buzz-cli = pkgs.callPackage ../../../../pkgs/buzz-cli { };
# Buzz profile name: the Hermes name the host passes to the gateway.
buzzName = config.services.hermes-agent.environment.API_SERVER_MODEL_NAME or "sibli";
in
{
# The user has no password; ssh keys only.
@@ -37,6 +39,48 @@ in
# Hermes's Buzz platform runs `buzz`; the service PATH has no system packages.
services.hermes-agent.environment.BUZZ_CLI_PATH = "${buzz-cli}/bin/buzz";
# A new Buzz key has no profile, and Hermes won't connect without one.
# Publish one at start if missing; the relay keeps it across resets.
systemd.services.buzz-profile = {
description = "Publish the Buzz profile if missing";
wantedBy = [ "multi-user.target" ];
before = [ "hermes-agent.service" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
path = [ buzz-cli pkgs.jq ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
User = "hermes";
# Same secrets as Hermes (container credentials from the host).
EnvironmentFile = config.systemd.services.hermes-agent.serviceConfig.EnvironmentFile;
};
script = ''
if [ -z "''${BUZZ_PRIVATE_KEY:-}" ] || [ -z "''${BUZZ_RELAY_URL:-}" ]; then
echo "No Buzz creds, skipping."
exit 0
fi
# Retry: the relay may not be reachable yet. Failure is not fatal.
for _ in 1 2 3 4 5; do
n=""
if out=$(buzz users get); then
n=$(jq 'length' <<<"$out") || n=""
fi
if [ "$n" = "0" ]; then
if buzz users set-profile --name ${lib.escapeShellArg buzzName}; then
echo "Published Buzz profile."
exit 0
fi
elif [ -n "$n" ]; then
echo "Buzz profile exists."
exit 0
fi
sleep 5
done
echo "Could not check or publish the Buzz profile." >&2
'';
};
# Docker + compose. Needs allowDocker = true on the host.
virtualisation.docker.enable = true;
users.users.ari.extraGroups = [ "docker" ];