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:
1 parent
d25015bc9d
commit
5a66da916d
4 files changed
+38
-1
No files matched your search
@@ -1,6 +1,10 @@
|
|||||||
{
|
{
|
||||||
age = {
|
age = {
|
||||||
secrets = {
|
secrets = {
|
||||||
|
hermes-gitea-token = {
|
||||||
|
file = ../../secrets/hermes-gitea-token.age;
|
||||||
|
owner = "m3tam3re";
|
||||||
|
};
|
||||||
hermes-env = {
|
hermes-env = {
|
||||||
file = ../../secrets/hermes-env.age;
|
file = ../../secrets/hermes-env.age;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
# - Gitea SSH: m3tam3re's ssh config pins User gitea + key ~/.ssh/gitea
|
# - Gitea SSH: m3tam3re's ssh config pins User gitea + key ~/.ssh/gitea
|
||||||
# (one-time keygen; pubkey added to the m3ta-chiron account) for
|
# (one-time keygen; pubkey added to the m3ta-chiron account) for
|
||||||
# interactive use and git+ssh:// flake inputs. Host key pinned system-wide.
|
# 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 —
|
# One-time interactive steps after deploy (deliberately NOT declarative —
|
||||||
# subscription auth must live in each harness's own credential store and
|
# subscription auth must live in each harness's own credential store and
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
{
|
{
|
||||||
age = {
|
age = {
|
||||||
secrets = {
|
secrets = {
|
||||||
|
hermes-gitea-token = {
|
||||||
|
file = ../../secrets/hermes-gitea-token.age;
|
||||||
|
owner = "m3tam3re";
|
||||||
|
};
|
||||||
anytype-key = {
|
anytype-key = {
|
||||||
file = ../../secrets/anytype-key.age;
|
file = ../../secrets/anytype-key.age;
|
||||||
owner = "m3tam3re";
|
owner = "m3tam3re";
|
||||||
|
|||||||
+28
-1
@@ -82,6 +82,9 @@
|
|||||||
# Push auth needs ~/.ssh/m3ta-chiron on each host, with its pubkey on the
|
# 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
|
# 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.
|
# 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
|
t3code-agent-identity = final: prev: let
|
||||||
identity = {
|
identity = {
|
||||||
name = "m3ta-chiron";
|
name = "m3ta-chiron";
|
||||||
@@ -106,6 +109,30 @@
|
|||||||
Include ~/.ssh/config
|
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}") {
|
wrapperArgs = final.lib.concatStringsSep " " (final.lib.mapAttrsToList (name: value: "--set ${name} ${final.lib.escapeShellArg value}") {
|
||||||
GIT_AUTHOR_NAME = identity.name;
|
GIT_AUTHOR_NAME = identity.name;
|
||||||
GIT_AUTHOR_EMAIL = identity.email;
|
GIT_AUTHOR_EMAIL = identity.email;
|
||||||
@@ -125,7 +152,7 @@
|
|||||||
nativeBuildInputs = [final.makeWrapper];
|
nativeBuildInputs = [final.makeWrapper];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
for program in $out/bin/*; do
|
for program in $out/bin/*; do
|
||||||
wrapProgram "$program" ${wrapperArgs}
|
wrapProgram "$program" ${wrapperArgs} --prefix PATH : ${agentTea}/bin
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user