setup siblix on buzz working
This commit is contained in:
1 parent
2e8529fff0
commit
0efbc5817b
8 files changed
+60
-8
No files matched your search
@@ -1 +1 @@
|
|||||||
/nix/store/8wpcklj1m0cp057gvc6ksvkc6znlipd5-pre-commit-config.json
|
/nix/store/5z8yjkavrsi0zy030pcbz60ndxy248vy-pre-commit-config.json
|
||||||
@@ -31,7 +31,6 @@ in
|
|||||||
hostAccess = [
|
hostAccess = [
|
||||||
{ port = ports.ollama; }
|
{ port = ports.ollama; }
|
||||||
{ port = ports.ds4; }
|
{ port = ports.ds4; }
|
||||||
# Primary skyg-linux-tracker on this host (it consolidates the lab).
|
|
||||||
{ port = ports.tracker; }
|
{ port = ports.tracker; }
|
||||||
];
|
];
|
||||||
lanAccess = [
|
lanAccess = [
|
||||||
|
|||||||
@@ -26,7 +26,12 @@ in
|
|||||||
hostAccess = [
|
hostAccess = [
|
||||||
{ port = ports.ollama; }
|
{ 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.
|
# A Hermes agent in every robot.
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
# sibli is ephemeral: root resets to this config on every start, so change
|
# sibli is ephemeral: root resets to this config on every start, so change
|
||||||
# things here (then rebuild the host), not inside the robot.
|
# things here (then rebuild the host), not inside the robot.
|
||||||
{ pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
# The robot's own nixpkgs has no host overlay, so build it from the repo.
|
# 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.
|
# Fine for the seed build; a rebuild inside the robot can't see this path.
|
||||||
buzz-cli = pkgs.callPackage ../../../../pkgs/buzz-cli { };
|
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
|
in
|
||||||
{
|
{
|
||||||
# The user has no password; ssh keys only.
|
# 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.
|
# Hermes's Buzz platform runs `buzz`; the service PATH has no system packages.
|
||||||
services.hermes-agent.environment.BUZZ_CLI_PATH = "${buzz-cli}/bin/buzz";
|
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.
|
# Docker + compose. Needs allowDocker = true on the host.
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
users.users.ari.extraGroups = [ "docker" ];
|
users.users.ari.extraGroups = [ "docker" ];
|
||||||
|
|||||||
@@ -173,13 +173,17 @@ Each robot gets its own Buzz (Nostr) identity in its own `robots-<name>` secret:
|
|||||||
limits it, `--restricted` allows no one.
|
limits it, `--restricted` allows no one.
|
||||||
2. Add the printed npub to the relay: `sudo buzz-manage add-member <npub>` on
|
2. Add the printed npub to the relay: `sudo buzz-manage add-member <npub>` on
|
||||||
hl-minipc1.
|
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
|
nixpkgs has no host overlay, so its config builds it with
|
||||||
`pkgs.callPackage <repo>/pkgs/buzz-cli { }` and points `BUZZ_CLI_PATH` at it
|
`pkgs.callPackage <repo>/pkgs/buzz-cli { }` and points `BUZZ_CLI_PATH` at it
|
||||||
(`services.hermes-agent.environment`), because the service PATH has no
|
(`services.hermes-agent.environment`), because the service PATH has no
|
||||||
system packages. That relative path only resolves for the host's seed
|
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
|
build, not for a rebuild inside the robot. Restart the robot after the
|
||||||
secret changes.
|
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)
|
## Docker and Tailscale (opt-in, host side only)
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
# The workspace has git deps in [patch.crates-io]; cargoHash covers them.
|
# 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, ...).
|
# Only this crate; the workspace has 30+ others (relay, db, ...).
|
||||||
cargoBuildFlags = [ "-p" "buzz-cli" ];
|
cargoBuildFlags = [ "-p" "buzz-cli" ];
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
pname = "delta-editor";
|
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";
|
apiUrl = "https://delta.dev/api/releases/nightly/${version}/asset?asset=delta&os=linux&arch=x86_64";
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ let
|
|||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
outputHashMode = "flat";
|
outputHashMode = "flat";
|
||||||
outputHash = "sha256-97/XaIOQo5ni077fRErzfN2IK5jh5PjxFE1vK5Z7Oco=";
|
outputHash = "sha256-lN5oSycdw1n3AswiGcsB4/jR481noJ5zv3qay5CTXso=";
|
||||||
|
|
||||||
nativeBuildInputs = [ curl jq cacert ];
|
nativeBuildInputs = [ curl jq cacert ];
|
||||||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user