3 ms·
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.
by soneil 2y ago
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.
- IsDanielB 2y agosystemd has `/etc/environment.d/`[1], which can be used to set/update `PATH`. Support for getting that into a users session isn't very wide (currently GDM and KDE plasma only[2]), but hopefully will be in the future. [1]: https://www.freedesktop.org/software/systemd/man/latest/environment.d.html https://www.freedesktop.org/software/systemd/man/latest/envi... [2]: https://wiki.archlinux.org/title/Environment_variables#Per_Wayland_session https://wiki.archlinux.org/title/Environment_variables#Per_W...
- o11c 2y agoThere are a couple of problems with environment.d - it cannot be made idempotent, and can't splice into the middle. 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.
- hnbear 2y agoI've used a Mac and linux for 20+ years and never knew about this. Maybe coming to OS X from linux meant I never bothered to ask the official way to set a path. How did you find out about it? This feels like a hidden secret. Is that directory maintained across OS updates?