Compare commits

...
9 Commits
Author SHA1 Message Date
m3tam3re d4cc6d80d8 Merge branch 'fix/m3-kratos-t3code-firewall' 2026-11-01 13:27:48 +01:00
m3tam3re 0c52f97bde Merge branch 'fix/t3code-gitea-provider' 2026-11-01 13:27:48 +01:00
m3tam3re 1cf5cb44ea Merge branch 'chore/remove-fish' 2026-11-01 13:27:48 +01:00
m3tam3reandClaude Opus 5.5 ee0a8908d0 feat(m3-kratos): allow T3 Code port from the NetBird mesh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:26:53 +01:00
m3tam3reandClaude Opus 5.5 5a66da916d fix(t3code): recognize code.m3ta.dev as Gitea for change requests
T3 only detects a Gitea on a custom domain through a matching tea or fj
login, so creating a change request failed with "No unknown source control
provider is registered". Put tea on T3's PATH with an m3ta-chiron login built
at runtime from the hermes-gitea-token agenix secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:24:11 +01:00
m3ta-chironandClaude Opus 5.5 b20861c991 chore: stop tracking the Beads gate lock
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:23:40 +01:00
m3tam3re 8a9fb31c9a chore: remove fish shell from host configs
- Drop fish.enable from the desktop, portable, and server shell profiles in hosts/common/users/m3tam3re.nix
- Remove programs.fish.enable from m3-atlas, m3-helios, m3-hermes, and m3-kratos
2026-11-01 13:19:03 +01:00
m3ta-chironandClaude Opus 5.5 d25015bc9d fix(t3code): run T3 agents as m3ta-chiron on every host
The identity lived in the m3-hermes service and in home-manager session
variables. Neither reaches the T3 desktop app on m3-kratos, so its agents
committed and pushed as m3tam3re. Wrap the T3 packages via an overlay so
everything T3 spawns inherits commit identity and Gitea push auth,
independent of host and launcher.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:14:02 +01:00
m3tam3reandClaude Opus 5.5 a2d226583f fix(t3code): provide Beads to T3 Code agents on m3-hermes
bd was neither on the t3code service PATH nor on the system. Add it to
both, like the harnesses, and set BEADS_ACTOR so the audit trail matches
the m3ta-chiron commit identity.

Also take the bd 1.3.2 migration of .beads (config, gitignore, hooks) and
ignore the .beads.gate.lock it creates in the repo root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:09:34 +01:00
20 changed files with 367 additions and 91 deletions

No files matched your search

+7
View File
@@ -71,3 +71,10 @@ bd.db
# They would override fork protection in .git/info/exclude.
# Config files (metadata.json, config.yaml) are tracked by git by default
# since no pattern above ignores them.
# Added by bd (missing required patterns)
*.gate.lock*
last_pull
proxieddb/
dolt-server-config.yaml
proxied_server_client_info.json
+2 -1
View File
@@ -53,4 +53,5 @@
# - github.org
# - github.repo
sync.remote: "git+ssh://gitea@code.m3ta.dev/m3tam3re/nixos-config.git"
sync:
remote: "git+ssh://gitea@code.m3ta.dev/m3tam3re/nixos-config.git"
+46 -11
View File
@@ -1,24 +1,59 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.0.3 ---
# --- BEGIN BEADS INTEGRATION v1.3.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run post-checkout "$@"
_bd_exit=$?
if [ $_bd_exit -eq 124 ]; then
echo >&2 "beads: hook 'post-checkout' timed out after ${_bd_timeout}s — continuing without beads"
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run post-checkout "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run post-checkout "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
bd hooks run post-checkout "$@"
_bd_exit=$?
echo >&2 "beads: hook 'post-checkout' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run post-checkout "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if [ $_bd_exit -eq 3 ]; then
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'post-checkout' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'post-checkout'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.0.3 ---
# --- END BEADS INTEGRATION v1.3.2 ---
+46 -11
View File
@@ -1,24 +1,59 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.0.3 ---
# --- BEGIN BEADS INTEGRATION v1.3.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run post-merge "$@"
_bd_exit=$?
if [ $_bd_exit -eq 124 ]; then
echo >&2 "beads: hook 'post-merge' timed out after ${_bd_timeout}s — continuing without beads"
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run post-merge "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run post-merge "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
bd hooks run post-merge "$@"
_bd_exit=$?
echo >&2 "beads: hook 'post-merge' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run post-merge "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if [ $_bd_exit -eq 3 ]; then
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'post-merge' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'post-merge'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.0.3 ---
# --- END BEADS INTEGRATION v1.3.2 ---
+46 -11
View File
@@ -1,24 +1,59 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.0.3 ---
# --- BEGIN BEADS INTEGRATION v1.3.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run pre-commit "$@"
_bd_exit=$?
if [ $_bd_exit -eq 124 ]; then
echo >&2 "beads: hook 'pre-commit' timed out after ${_bd_timeout}s — continuing without beads"
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run pre-commit "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run pre-commit "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
bd hooks run pre-commit "$@"
_bd_exit=$?
echo >&2 "beads: hook 'pre-commit' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run pre-commit "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if [ $_bd_exit -eq 3 ]; then
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'pre-commit' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'pre-commit'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.0.3 ---
# --- END BEADS INTEGRATION v1.3.2 ---
+46 -11
View File
@@ -1,24 +1,59 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.0.3 ---
# --- BEGIN BEADS INTEGRATION v1.3.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run pre-push "$@"
_bd_exit=$?
if [ $_bd_exit -eq 124 ]; then
echo >&2 "beads: hook 'pre-push' timed out after ${_bd_timeout}s — continuing without beads"
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run pre-push "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run pre-push "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
bd hooks run pre-push "$@"
_bd_exit=$?
echo >&2 "beads: hook 'pre-push' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run pre-push "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if [ $_bd_exit -eq 3 ]; then
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'pre-push' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'pre-push'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.0.3 ---
# --- END BEADS INTEGRATION v1.3.2 ---
+46 -11
View File
@@ -1,24 +1,59 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.0.3 ---
# --- BEGIN BEADS INTEGRATION v1.3.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run prepare-commit-msg "$@"
_bd_exit=$?
if [ $_bd_exit -eq 124 ]; then
echo >&2 "beads: hook 'prepare-commit-msg' timed out after ${_bd_timeout}s — continuing without beads"
case "$_bd_timeout" in
*[!0-9]*|'') _bd_timeout_invalid=1 ;;
*[1-9]*) _bd_timeout_invalid=0 ;;
*) _bd_timeout_invalid=1 ;;
esac
if [ "$_bd_timeout_invalid" -eq 1 ]; then
echo >&2 "beads: invalid BEADS_HOOK_TIMEOUT; using 300 seconds"
_bd_timeout=300
fi
_bd_timeout_backend=none
_bd_timeout_command=
for _bd_timeout_candidate in timeout gtimeout; do
if command -v "$_bd_timeout_candidate" >/dev/null 2>&1; then
if _bd_timeout_version="$("$_bd_timeout_candidate" --version 2>/dev/null)"; then
case "$_bd_timeout_version" in
"timeout (GNU coreutils) "*) _bd_timeout_command=$_bd_timeout_candidate; break ;;
esac
fi
fi
done
if [ -n "$_bd_timeout_command" ]; then
_bd_timeout_backend=coreutils
if "$_bd_timeout_command" -- "$_bd_timeout" bd hooks run prepare-commit-msg "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
elif command -v perl >/dev/null 2>&1; then
_bd_timeout_backend=perl
if perl -e 'alarm shift; exec @ARGV' -- "$_bd_timeout" bd hooks run prepare-commit-msg "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
else
bd hooks run prepare-commit-msg "$@"
_bd_exit=$?
echo >&2 "beads: hook 'prepare-commit-msg' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
if bd hooks run prepare-commit-msg "$@"; then
_bd_exit=0
else
_bd_exit=$?
fi
fi
if [ $_bd_exit -eq 3 ]; then
if { [ "$_bd_timeout_backend" = coreutils ] && [ "$_bd_exit" -eq 124 ]; } || { [ "$_bd_timeout_backend" = perl ] && [ "$_bd_exit" -eq 142 ]; }; then
echo >&2 "beads: hook 'prepare-commit-msg' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ "$_bd_exit" -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'prepare-commit-msg'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
if [ "$_bd_exit" -ne 0 ]; then exit "$_bd_exit"; fi
fi
# --- END BEADS INTEGRATION v1.0.3 ---
# --- END BEADS INTEGRATION v1.3.2 ---
+1
View File
@@ -46,6 +46,7 @@ CLAUDE.md
.dolt/
*.db
.beads-credential-key
.beads.gate.lock
# --- babysitter managed ---
.a5c/creds.env
+2
View File
@@ -49,6 +49,8 @@
# with allowUnfree). Do NOT flatten to top-level attrs — see
# overlays/default.nix.
inputs.llm-agents.overlays.shared-nixpkgs
# Wraps pkgs.llm-agents.t3code* with the agents' m3ta-chiron identity.
outputs.overlays.t3code-agent-identity
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
-3
View File
@@ -74,7 +74,6 @@
# Full desktop workstation
base = {
shell = {
fish.enable = true;
nushell.enable = true;
starship.enable = true;
};
@@ -142,7 +141,6 @@
# Portable laptop — desktop without gaming, no Hyprland
base = {
shell = {
fish.enable = true;
nushell.enable = true;
starship.enable = true;
};
@@ -207,7 +205,6 @@
# m3-helios, m3-hermes, m3-aether — minimal server
base = {
shell = {
fish.enable = true;
starship.enable = true;
};
cliTools = {
-1
View File
@@ -4,7 +4,6 @@
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
];
programs.fish.enable = true;
programs.mosh.enable = true;
programs.nh = {
enable = true;
-1
View File
@@ -4,7 +4,6 @@
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
];
programs.fish.enable = true;
programs.nh = {
enable = true;
clean.enable = true;
-1
View File
@@ -2,7 +2,6 @@
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [];
programs.mosh.enable = true;
programs.fish.enable = true;
programs.nh = {
enable = true;
clean.enable = true;
+4
View File
@@ -1,6 +1,10 @@
{
age = {
secrets = {
hermes-gitea-token = {
file = ../../secrets/hermes-gitea-token.age;
owner = "m3tam3re";
};
hermes-env = {
file = ../../secrets/hermes-env.age;
};
+19 -28
View File
@@ -16,12 +16,14 @@
# so no deploy token) into ~/.agents/skills + ~/.config/opencode/*. A
# path unit mirrors skills into ~/.claude/skills for Claude Code
# (port of m3ta-home profiles/sets/coding/agents/claude-skills.nix).
# - Git identity: every harness spawned by `t3 serve` commits as the
# m3ta-chiron bot account — via service env vars, deliberately NOT via
# ~/.gitconfig, so m3tam3re's interactive git on this host is untouched.
# - Git identity and Gitea push auth: m3ta-chiron for every harness spawned
# by T3, baked into the package (overlays/default.nix,
# t3code-agent-identity), so m3tam3re's interactive git is untouched.
# - Gitea SSH: m3tam3re's ssh config pins User gitea + key ~/.ssh/gitea
# (one-time keygen; pubkey added to the m3ta-chiron account) — covers
# git remotes AND git+ssh:// flake inputs. Host key pinned system-wide.
# (one-time keygen; pubkey added to the m3ta-chiron account) for
# interactive use and git+ssh:// flake inputs. Host key pinned system-wide.
# - Gitea change requests: tea with the hermes-gitea-token agenix secret,
# baked into the same package.
#
# One-time interactive steps after deploy (deliberately NOT declarative —
# subscription auth must live in each harness's own credential store and
@@ -53,16 +55,6 @@
cockpitUser = "m3tam3re";
cockpitHome = "/home/${cockpitUser}";
# Commit identity of the T3 Code agents: the fleet bot account. Env
# vars are respected by git in every process the service spawns; they
# survive restarts and stay out of m3tam3re's dotfiles.
gitIdentityEnv = {
GIT_AUTHOR_NAME = "m3ta-chiron";
GIT_AUTHOR_EMAIL = "m3ta-chiron@agentmail.to";
GIT_COMMITTER_NAME = "m3ta-chiron";
GIT_COMMITTER_EMAIL = "m3ta-chiron@agentmail.to";
};
# SSH to the private Gitea for the T3 lane. Sits in m3tam3re's ssh
# config (per-user — Hermes' own gitea access via its own ssh config
# is unaffected). URL-embedded users (gitea@code.m3ta.dev) match the
@@ -115,6 +107,7 @@ in {
pkgs.llm-agents.t3code
pkgs.llm-agents.opencode2
pkgs.llm-agents.claude-code
pkgs.llm-agents.beads
pkgs.agent-lib
];
@@ -134,25 +127,21 @@ in {
RestartSec = "5";
};
environment =
{
T3CODE_PORT = toString port;
# Deterministic service context: HOME explicit so ssh/git resolve
# ~ in every process this service spawns, however deep t3's
# pty/sandbox chain resets the environment.
HOME = cockpitHome;
# Independent of HOME entirely: git uses exactly this ssh config
# (absolute store path) for every gitea remote.
GIT_SSH_COMMAND = "ssh -F ${t3SshConfig}";
}
// gitIdentityEnv;
environment = {
T3CODE_PORT = toString port;
# Deterministic service context: HOME explicit so tools resolve ~ in
# every process this service spawns, however deep t3's pty/sandbox
# chain resets the environment.
HOME = cockpitHome;
};
# Harness CLIs and git for the agents T3 Code spawns.
# Harness CLIs, git and the issue tracker for the agents T3 Code spawns.
path = with pkgs; [
git
openssh
llm-agents.opencode2
llm-agents.claude-code
llm-agents.beads
];
};
@@ -171,6 +160,8 @@ in {
systemd.tmpfiles.rules = [
"d ${cockpitHome}/.ssh 0700 ${cockpitUser} users -"
"L+ ${cockpitHome}/.ssh/config - - - - ${t3SshConfig}"
# The fleet-wide key path the T3 package expects (see t3code-agent-identity).
"L+ ${cockpitHome}/.ssh/m3ta-chiron - - - - ${cockpitHome}/.ssh/gitea"
];
# ── agent-lib v2 client: skills/commands/agents for the harnesses ────
-1
View File
@@ -31,7 +31,6 @@
wlrobs
];
};
programs.fish.enable = true;
programs.thunar = {
enable = true;
plugins = with pkgs; [thunar-archive-plugin thunar-volman];
+4
View File
@@ -1,6 +1,10 @@
{
age = {
secrets = {
hermes-gitea-token = {
file = ../../secrets/hermes-gitea-token.age;
owner = "m3tam3re";
};
anytype-key = {
file = ../../secrets/anytype-key.age;
owner = "m3tam3re";
+1
View File
@@ -6,6 +6,7 @@
./netbird.nix
./postgres.nix
./sound.nix
./t3code.nix
./udev.nix
./wireguard.nix
];
+6
View File
@@ -0,0 +1,6 @@
{config, ...}: {
# T3 Code desktop server: reachable from NetBird mesh peers only.
networking.firewall.interfaces.wt0.allowedTCPPorts = [
(config.m3ta.ports.get "t3code")
];
}
+91
View File
@@ -74,6 +74,97 @@
opencode-desktop = final.llm-agents.opencode2-desktop;
};
# T3 Code agents act as the m3ta-chiron bot on every host. Baked into the
# T3 packages rather than a session or service: everything T3 spawns
# inherits it, however T3 was launched (desktop launcher, systemd, shell),
# and any host installing T3 gets it. Must come AFTER shared-nixpkgs.
#
# Push auth needs ~/.ssh/m3ta-chiron on each host, with its pubkey on the
# m3ta-chiron Gitea account. A missing key fails the push instead of falling
# back to a personal key. Other hosts keep the user's own ssh config.
#
# Change requests need the agenix secret hermes-gitea-token on each host,
# owned by the T3 user. Without it T3 cannot recognize code.m3ta.dev as Gitea.
t3code-agent-identity = final: prev: let
identity = {
name = "m3ta-chiron";
email = "m3ta-chiron@agentmail.to";
};
giteaKnownHosts = final.writeText "gitea-known-hosts" ''
code.m3ta.dev ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFmmqZ4GgDEXJgj8uYrZAr/EoLIA6LJGkTIyKGQD/60a
'';
# ssh expands ~ from passwd, so this does not depend on $HOME.
sshConfig = final.writeText "t3-agent-ssh-config" ''
Host code.m3ta.dev
User gitea
IdentityFile ~/.ssh/m3ta-chiron
IdentitiesOnly yes
UserKnownHostsFile ${giteaKnownHosts}
# Conditional: IdentityFile accumulates across matching blocks, so a
# personal code.m3ta.dev entry must not be read for this host.
Host * !code.m3ta.dev
Include ~/.ssh/config
'';
# T3 only recognizes a Gitea on a custom domain through a matching tea
# login. The config lives in a private temp dir per call, so the token stays
# out of the nix store and a personal ~/.config/tea is left alone.
giteaTokenFile = "/run/agenix/hermes-gitea-token";
agentTea = final.writeShellApplication {
name = "tea";
text = ''
config="$(${final.coreutils}/bin/mktemp -d)"
trap '${final.coreutils}/bin/rm -rf "$config"' EXIT
${final.coreutils}/bin/mkdir "$config/tea"
if [ -r ${giteaTokenFile} ]; then
${final.coreutils}/bin/cat > "$config/tea/config.yml" <<EOF
logins:
- name: m3ta
url: https://code.m3ta.dev
token: $(${final.coreutils}/bin/cat ${giteaTokenFile})
user: ${identity.name}
default: true
EOF
fi
XDG_CONFIG_HOME="$config" ${final.tea}/bin/tea "$@"
'';
};
wrapperArgs = final.lib.concatStringsSep " " (final.lib.mapAttrsToList (name: value: "--set ${name} ${final.lib.escapeShellArg value}") {
GIT_AUTHOR_NAME = identity.name;
GIT_AUTHOR_EMAIL = identity.email;
GIT_COMMITTER_NAME = identity.name;
GIT_COMMITTER_EMAIL = identity.email;
JJ_USER = identity.name;
JJ_EMAIL = identity.email;
# bd otherwise falls back to the user's git user.name for its audit trail.
BEADS_ACTOR = identity.name;
GIT_SSH_COMMAND = "${final.openssh}/bin/ssh -F ${sshConfig}";
});
wrapT3 = package:
final.symlinkJoin {
inherit (package) name meta passthru;
paths = [package];
nativeBuildInputs = [final.makeWrapper];
postBuild = ''
for program in $out/bin/*; do
wrapProgram "$program" ${wrapperArgs} --prefix PATH : ${agentTea}/bin
done
'';
};
in {
llm-agents =
prev.llm-agents
// {
t3code = wrapT3 prev.llm-agents.t3code;
t3code-desktop = wrapT3 prev.llm-agents.t3code-desktop;
};
};
# temp-packages = final: _prev: {
# temp = import inputs.nixpkgs-9e9486b {
# system = final.stdenv.hostPlatform.system;