I really like the /etc/paths.d/ mechanism the mac uses. Such a simple thing, I'm surprised I haven't seen it adopted elsewhere.
[1]: https://www.freedesktop.org/software/systemd/man/latest/envi... [2]: https://wiki.archlinux.org/title/Environment_variables#Per_W...
These shouldn't be a problem since it runs early enough and should be controlled by a single sane party, but makes porting a pain.
I don't understand what problem your [2] link is referring to, since the whole point of systemd user sessions is that it happens before graphical stuff.
How did you find out about it? This feels like a hidden secret.
Is that directory maintained across OS updates?