From 5a66da916d9577900ccaf89867412c6c78e0a248 Mon Sep 17 00:00:00 2001
From: m3tam3re
Date: Sun, 1 Nov 2026 13:24:11 +0100
Subject: [PATCH] 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
---
hosts/m3-hermes/secrets.nix | 4 ++++
hosts/m3-hermes/services/t3code.nix | 2 ++
hosts/m3-kratos/secrets.nix | 4 ++++
overlays/default.nix | 29 ++++++++++++++++++++++++++++-
4 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/hosts/m3-hermes/secrets.nix b/hosts/m3-hermes/secrets.nix
index 9a3b8d2..156d399 100644
--- a/hosts/m3-hermes/secrets.nix
+++ b/hosts/m3-hermes/secrets.nix
@@ -1,6 +1,10 @@
{
age = {
secrets = {
+ hermes-gitea-token = {
+ file = ../../secrets/hermes-gitea-token.age;
+ owner = "m3tam3re";
+ };
hermes-env = {
file = ../../secrets/hermes-env.age;
};
diff --git a/hosts/m3-hermes/services/t3code.nix b/hosts/m3-hermes/services/t3code.nix
index c57c7c7..c4915ba 100644
--- a/hosts/m3-hermes/services/t3code.nix
+++ b/hosts/m3-hermes/services/t3code.nix
@@ -22,6 +22,8 @@
# - Gitea SSH: m3tam3re's ssh config pins User gitea + key ~/.ssh/gitea
# (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
diff --git a/hosts/m3-kratos/secrets.nix b/hosts/m3-kratos/secrets.nix
index 0ee16ad..3a580ff 100644
--- a/hosts/m3-kratos/secrets.nix
+++ b/hosts/m3-kratos/secrets.nix
@@ -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";
diff --git a/overlays/default.nix b/overlays/default.nix
index f2f8861..cba45fd 100644
--- a/overlays/default.nix
+++ b/overlays/default.nix
@@ -82,6 +82,9 @@
# 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";
@@ -106,6 +109,30 @@
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" <