feat(m3-hermes): T3 Code cockpit — t3 serve systemd service, mesh-only #26
No files matched your search
@@ -46,6 +46,9 @@
|
|||||||
hermes-dashboard = 9119;
|
hermes-dashboard = 9119;
|
||||||
ai-memory = 49374;
|
ai-memory = 49374;
|
||||||
|
|
||||||
|
# Agent cockpit
|
||||||
|
t3code = 3773;
|
||||||
|
|
||||||
# Home automation
|
# Home automation
|
||||||
homarr = 7575;
|
homarr = 7575;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
}: let
|
}: let
|
||||||
# Netbird mesh VPN range — the server is only reachable from mesh peers.
|
# Netbird mesh VPN range — the server is only reachable from mesh peers.
|
||||||
# m3-atlas Traefik proxies memory.m3ta.dev to this port over Netbird.
|
# m3-atlas Traefik proxies memory.m3ta.dev to this port over Netbird.
|
||||||
netbirdRange = "100.64.0.0/16";
|
# (Fleet mesh address block is 100.81.0.0/16 — kernel route on wt0.)
|
||||||
|
netbirdRange = "100.81.0.0/16";
|
||||||
port = config.m3ta.ports.get "ai-memory";
|
port = config.m3ta.ports.get "ai-memory";
|
||||||
in {
|
in {
|
||||||
# ── ai-memory server ──────────────────────────────────────────────────
|
# ── ai-memory server ──────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -5,5 +5,6 @@
|
|||||||
./hermes-dashboard.nix
|
./hermes-dashboard.nix
|
||||||
./ai-memory.nix
|
./ai-memory.nix
|
||||||
./netbird.nix
|
./netbird.nix
|
||||||
|
./t3code.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
}: let
|
}: let
|
||||||
# Netbird mesh VPN range — dashboard only accessible from mesh peers.
|
# Netbird mesh VPN range — dashboard only accessible from mesh peers.
|
||||||
# m3-atlas Traefik proxies to this port over Netbird.
|
# m3-atlas Traefik proxies to this port over Netbird.
|
||||||
netbirdRange = "100.64.0.0/16";
|
netbirdRange = "100.81.0.0/16";
|
||||||
apiPort = config.m3ta.ports.get "hermes-api";
|
apiPort = config.m3ta.ports.get "hermes-api";
|
||||||
dashboardPort = config.m3ta.ports.get "hermes-dashboard";
|
dashboardPort = config.m3ta.ports.get "hermes-dashboard";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
# T3 Code server (https://t3.codes) — interactive coding-agent cockpit.
|
||||||
|
#
|
||||||
|
# Part of the three-lane agent setup (agreed 2026-10-26):
|
||||||
|
# - Lane 1, interactive cockpit: T3 Code on m3-hermes, reached over the
|
||||||
|
# NetBird mesh via direct pairing (no T3 Connect cloud relay).
|
||||||
|
# - Lane 2, autonomous workers: herdr sandbox (see herdr-sandbox.nix).
|
||||||
|
# - Lane 3, control & inbox: Hermes via Matrix (unchanged).
|
||||||
|
#
|
||||||
|
# Flow: T3 desktop/mobile app ──NetBird mesh──▶ wt0 :3773 (this server).
|
||||||
|
# The server binds 0.0.0.0, but the firewall admits the port for mesh
|
||||||
|
# peers only — same posture as ai-memory and the hermes dashboard.
|
||||||
|
#
|
||||||
|
# One-time interactive steps after deploy (deliberately NOT declarative —
|
||||||
|
# subscription auth must live in each harness's own credential store and
|
||||||
|
# may not be shared with other tools per provider ToS):
|
||||||
|
# - Pair clients: `sudo -u m3tam3re t3 pair` (or take the pairing URL
|
||||||
|
# from `journalctl -u t3code` after first start) and add the
|
||||||
|
# environment in the T3 app via the printed URL/QR code.
|
||||||
|
# - Claude Code: `sudo -u m3tam3re claude auth login`
|
||||||
|
# (persists in /home/m3tam3re/.claude).
|
||||||
|
# - OpenCode: `sudo -u m3tam3re opencode auth login`
|
||||||
|
# (subscription auth persists in OpenCode's own state dir).
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
# NetBird mesh range of this fleet (kernel route: 100.81.0.0/16 dev wt0).
|
||||||
|
netbirdRange = "100.81.0.0/16";
|
||||||
|
port = config.m3ta.ports.get "t3code";
|
||||||
|
in {
|
||||||
|
# CLI on the system for interactive admin (t3 pair, t3 service status)
|
||||||
|
# plus the harnesses T3 Code orchestrates. Login shells need them for
|
||||||
|
# the one-time auth flows documented in the header.
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.llm-agents.t3code
|
||||||
|
pkgs.llm-agents.opencode2
|
||||||
|
pkgs.llm-agents.claude-code
|
||||||
|
];
|
||||||
|
|
||||||
|
# ── T3 Code server (system service, cockpit user) ────────────────────
|
||||||
|
systemd.services.t3code = {
|
||||||
|
description = "T3 Code server (interactive coding-agent cockpit)";
|
||||||
|
after = ["network-online.target"];
|
||||||
|
wants = ["network-online.target"];
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
User = "m3tam3re";
|
||||||
|
Group = "users";
|
||||||
|
WorkingDirectory = "/home/m3tam3re";
|
||||||
|
ExecStart = "${pkgs.llm-agents.t3code}/bin/t3 serve --host 0.0.0.0";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "5";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.T3CODE_PORT = toString port;
|
||||||
|
|
||||||
|
# Harness CLIs and git for the agents T3 Code spawns.
|
||||||
|
path = with pkgs; [
|
||||||
|
git
|
||||||
|
llm-agents.opencode2
|
||||||
|
llm-agents.claude-code
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
extraCommands = ''
|
||||||
|
# Allow t3code only from Netbird mesh VPN
|
||||||
|
ip46tables -A nixos-fw -p tcp --dport ${toString port} -s ${netbirdRange} -j nixos-fw-accept
|
||||||
|
'';
|
||||||
|
|
||||||
|
extraStopCommands = ''
|
||||||
|
ip46tables -D nixos-fw -p tcp --dport ${toString port} -s ${netbirdRange} -j nixos-fw-accept 2>/dev/null || true
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in new issue
Block a user