From 0efbc5817bfe9dd1c98bb7abd7e3d8e0449ea6e4 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Tue, 27 Oct 2026 09:56:57 -0400 Subject: [PATCH] setup siblix on buzz working --- .pre-commit-config.yaml | 2 +- hosts/hl-fwdesk/services/hermenix.nix | 1 - hosts/hl-fwdesk/services/robotnix.nix | 7 ++- hosts/hl-fwdesk/services/robotnix/sibli.nix | 46 +++++++++++++++++++- modules/nixos/server/robotnix/ABOUTME.md | 6 ++- pkgs/buzz-cli/default.nix | 2 +- pkgs/delta-editor/default.nix | 4 +- secrets/robots-sibli.age | Bin 668 -> 668 bytes 8 files changed, 60 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a5ddd03..2b87a8a 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/8wpcklj1m0cp057gvc6ksvkc6znlipd5-pre-commit-config.json \ No newline at end of file +/nix/store/5z8yjkavrsi0zy030pcbz60ndxy248vy-pre-commit-config.json \ No newline at end of file diff --git a/hosts/hl-fwdesk/services/hermenix.nix b/hosts/hl-fwdesk/services/hermenix.nix index 1e374cf..00080a4 100644 --- a/hosts/hl-fwdesk/services/hermenix.nix +++ b/hosts/hl-fwdesk/services/hermenix.nix @@ -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 = [ diff --git a/hosts/hl-fwdesk/services/robotnix.nix b/hosts/hl-fwdesk/services/robotnix.nix index 1f003d6..eea08b3 100644 --- a/hosts/hl-fwdesk/services/robotnix.nix +++ b/hosts/hl-fwdesk/services/robotnix.nix @@ -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. diff --git a/hosts/hl-fwdesk/services/robotnix/sibli.nix b/hosts/hl-fwdesk/services/robotnix/sibli.nix index 4193ef0..6f9bfe3 100644 --- a/hosts/hl-fwdesk/services/robotnix/sibli.nix +++ b/hosts/hl-fwdesk/services/robotnix/sibli.nix @@ -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" ]; diff --git a/modules/nixos/server/robotnix/ABOUTME.md b/modules/nixos/server/robotnix/ABOUTME.md index 9dbb853..b5dee41 100644 --- a/modules/nixos/server/robotnix/ABOUTME.md +++ b/modules/nixos/server/robotnix/ABOUTME.md @@ -173,13 +173,17 @@ Each robot gets its own Buzz (Nostr) identity in its own `robots-` secret: limits it, `--restricted` allows no one. 2. Add the printed npub to the relay: `sudo buzz-manage add-member ` on hl-minipc1. -3. The robot needs `lanAccess` to the relay and the `buzz` CLI. The robot's +3. The robot needs `lanAccess` to the relay (`10.0.101.3` ports 443, 3000, + 8080, 9102; the default relay URL uses 443) and the `buzz` CLI. The robot's nixpkgs has no host overlay, so its config builds it with `pkgs.callPackage /pkgs/buzz-cli { }` and points `BUZZ_CLI_PATH` at it (`services.hermes-agent.environment`), because the service PATH has no system packages. That relative path only resolves for the host's seed build, not for a rebuild inside the robot. Restart the robot after the secret changes. +4. A new key has no profile, and Hermes won't connect without one + (`buzz users get returned no profile`). sibli runs a `buzz-profile` + oneshot at start that calls `buzz users set-profile` when the key has none. ## Docker and Tailscale (opt-in, host side only) diff --git a/pkgs/buzz-cli/default.nix b/pkgs/buzz-cli/default.nix index ec0a2f5..28f6b10 100644 --- a/pkgs/buzz-cli/default.nix +++ b/pkgs/buzz-cli/default.nix @@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec { }; # The workspace has git deps in [patch.crates-io]; cargoHash covers them. - cargoHash = "sha256-UQ8qNqoeDwkwhmVZebi++gb2GP61dr1Zv2QU9mJ6KJ8="; + cargoHash = lib.fakeHash; # Only this crate; the workspace has 30+ others (relay, db, ...). cargoBuildFlags = [ "-p" "buzz-cli" ]; diff --git a/pkgs/delta-editor/default.nix b/pkgs/delta-editor/default.nix index 4188c3e..3a7e8b8 100644 --- a/pkgs/delta-editor/default.nix +++ b/pkgs/delta-editor/default.nix @@ -29,7 +29,7 @@ let pname = "delta-editor"; - version = "0.20.1"; + version = "0.21.0"; apiUrl = "https://delta.dev/api/releases/nightly/${version}/asset?asset=delta&os=linux&arch=x86_64"; @@ -38,7 +38,7 @@ let inherit version; outputHashMode = "flat"; - outputHash = "sha256-97/XaIOQo5ni077fRErzfN2IK5jh5PjxFE1vK5Z7Oco="; + outputHash = "sha256-lN5oSycdw1n3AswiGcsB4/jR481noJ5zv3qay5CTXso="; nativeBuildInputs = [ curl jq cacert ]; SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; diff --git a/secrets/robots-sibli.age b/secrets/robots-sibli.age index 169a5d305fd3880cebdabd57c90b295d77e89dfd..faeae86c4eb97fc19f16a8363a9f48264c7daa6f 100644 GIT binary patch delta 635 zcmV->0)+jX1)K$tEPpvvWMVLLIWRddcW`JK6o3OP(%H=24COzIaO!#dEqTjsvtkV7}GvUuvBHH4PCp+bGQh(SpZrCN9c9b9gJq-`ZsC?TI=cGb05Ezfo zer{+NO>{vLXJ0JAswTsCyLndC0pnH1 zSNPt65!OoQ7NbBgftH}&A*OPjp%Ap>ZEaw3OcS>o6N9EvXTsl(p(OzJ#JT*!vL*KZ Vv`BdgLS+(fj7^T6k?;~Wy`no)4@Uq1 delta 635 zcmV->0)+jX1)K$tEPqXFa7%hvWI;=5V?tzgV`Nx%X)9MoG)hWuSvf;Vc2-bWRB3u> zK{HZla|%X!dNOr5LTxWXR#q!cMtL+cctkL3P(x5jc~fdbd0KU7SWZqydQenESqd#a zAaiqQEoEdfH8n9gAZL0^RCjkEQgu~GQ&={7WpG4zG-_EySbtSEW;jP_Om#G5G*V?| zP&GAHZ9`>gb4yrb3T{_7Nku|WW@t}(V@XVCXH!CKWm$1XOm1#*RWW96PDWN{Hf}Lt zGdM>@3N0-yAX9WVF>XspQbcWNFl=ymZ*^mAWMw%oIZ1bLWO-V2FfmFm9rAU?-FZ&`x?-D(6zUC#|fI+&!e)piuDKBlp$fP#*w88-=~mvJ;kDn zIfQq|;1v^Wy~wdg*EnIjE&N12RYIHyt)o%|-wKVu5i%0gO^Wti5VHVB?_#nx^? zWfa)}`E*bq%J-3*TB5hLK@$FzE%GC6)uq9+!K0Lf^Yn3Ln4!QsU