From f762348fcaab973335f08ded3db5a362c11855ce Mon Sep 17 00:00:00 2001 From: damocles Date: Thu, 21 May 2026 22:52:37 +0200 Subject: [PATCH] harness: fix tea-login writing to /.config instead of /root/.config --- nix/templates/harness-base.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nix/templates/harness-base.nix b/nix/templates/harness-base.nix index b1ad1dd..11731be 100644 --- a/nix/templates/harness-base.nix +++ b/nix/templates/harness-base.nix @@ -390,10 +390,13 @@ echo "tea-login: could not resolve username from forge API; skipping" exit 0 fi - # tea reads config from $HOME/.config/tea/config.yml. + # tea reads config from ~/.config/tea/config.yml (for root: /root/.config/tea/config.yml). # Write it directly so we control default:true and always # refresh a rotated token — no 'tea login add' interactive dance. - CONFIG="$HOME/.config/tea/config.yml" + # Use getent to resolve root's home dir rather than $HOME which + # is unset in systemd service context (causing writes to /.config/). + _HOME=$(getent passwd root | cut -d: -f6) + CONFIG="$_HOME/.config/tea/config.yml" mkdir -p "$(dirname "$CONFIG")" || true cat > "$CONFIG" << EOF logins: