From 56f2295e6ea44c07b8132cb5e0c303c644e1544c Mon Sep 17 00:00:00 2001 From: m3ta-chiron Date: Sat, 31 Oct 2026 16:44:15 +0100 Subject: [PATCH] fix(t3code): make gitea SSH access HOME-independent in the service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- hosts/m3-hermes/services/t3code.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hosts/m3-hermes/services/t3code.nix b/hosts/m3-hermes/services/t3code.nix index 13e7e42..32246fd 100644 --- a/hosts/m3-hermes/services/t3code.nix +++ b/hosts/m3-hermes/services/t3code.nix @@ -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;