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>
This commit is contained in:
m3tam3reandClaude Opus 5.5 committed 2026-11-01 13:24:11 +01:00
1 parent d25015bc9d
commit 5a66da916d
4 files changed
+38 -1

No files matched your search

+28 -1
View File
@@ -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" <<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;
@@ -125,7 +152,7 @@
nativeBuildInputs = [final.makeWrapper];
postBuild = ''
for program in $out/bin/*; do
wrapProgram "$program" ${wrapperArgs}
wrapProgram "$program" ${wrapperArgs} --prefix PATH : ${agentTea}/bin
done
'';
};