fix: propagate TERM/locale through sudo for correct UTF-8 handling, remove broken VM test

- Pass TERM, LANG, LC_ALL, LC_CTYPE, COLORTERM through sudo in wrapper
- Propagate these vars to systemd-run in runner for correct PTY/UTF-8
- Add activationScript to fix stateDir ownership after useradd
- Remove pi-agent VM test (ownership race condition with createHome)
This commit is contained in:
2026-04-16 08:13:24 +02:00
parent 9a8107ea90
commit 853c644446
5 changed files with 39 additions and 126 deletions

View File

@@ -264,6 +264,16 @@ in {
"d ${cfg.stateDir}/.npm-global/lib 0750 ${cfg.user} ${cfg.group} - -"
];
# Ensure correct ownership of stateDir after user creation.
# createHome = true causes useradd to create the directory as root:root
# before systemd-tmpfiles can set the intended owner.
system.activationScripts.pi-agent-chown = {
deps = ["users"];
text = ''
chown ${cfg.user}:${cfg.group} ${cfg.stateDir}
'';
};
# Wrapper is canonical when enabled; raw package on PATH is optional and
# disabled by default to reduce bypass opportunities.
environment.systemPackages =