Persisting environment variables in CL

The documentation part of the CL website seems to be down, so here goes: what is the best method to persist environment variables in CL? So far I do not see an /etc/environment file on my CL computer: does CL make use of (“source”) this file upon reboot?

Do you use Wayland?
~/.config/environment.d/envvars.conf

1 Like

I don’t have a ~/.config/environment.d/ folder. Should I make one? Also, that looks to be user specific, whereas I’d like this to be a system-wide variable.

If you expect global level environment variables, “/etc/environment” is an one option.

Here is the other discussion though it is the old story.

I suppose “/etc/environment” is easier and more general approach.

2 Likes

I suppose “/etc/environment” is easier and more general approach.

https://www.freedesktop.org/software/systemd/man/environment.d.html

Usually Clear Linux does not create empty directories, so you need to
create the missing ones and add the file there.

1 Like

Thank you! I am guessing this type of info should be in the CL manual, only at this point in time the documentation site is offline.

Again about how CL does things: my (fresh) CL installation has none of the files or directories listed in the systemd specs, yet the env command lists quite a few environment variables (PATH being one of them(!)). Where are these stored? I am guessing at this point that these variables are not “systemd variables,” right?

/usr/share/defaults/etc/profile and the files in /usr/share/defaults/etc/profile.d

1 Like