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:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user