fix(t3code): make gitea SSH access HOME-independent in the service

The T3 threads could clone from gitea interactively (m3tam3re terminal)
but not from the t3code service context. Instead of guessing which link
in the spawn chain drops HOME, make every link irrelevant:

- t3SshConfig: absolute IdentityFile (no ~ resolution needed)
- service env: HOME set explicitly + GIT_SSH_COMMAND pointing at the
  absolute store-path ssh config — git uses exactly this config for
  gitea remotes regardless of HOME or user ssh-config lookup

Verified via nix eval: HOME=/home/m3tam3re and
GIT_SSH_COMMAND=ssh -F /nix/store/...-t3-gitea-ssh-config land in the
unit. After deploy: systemctl restart t3code, then retrigger the clone
thread.
This commit is contained in:
m3ta-chiron committed 2026-10-31 16:44:15 +01:00
1 parent 95f5b76629
commit 56f2295e6e
1 file changed
+8 -1
+8 -1
View File
@@ -71,7 +71,7 @@
t3SshConfig = pkgs.writeText "t3-gitea-ssh-config" ''
Host code.m3ta.dev
User gitea
IdentityFile ~/.ssh/gitea
IdentityFile ${cockpitHome}/.ssh/gitea
IdentitiesOnly yes
'';
@@ -137,6 +137,13 @@ in {
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;