Hi Folks,

I noticed that the common direnv idiom with "--pure" isn't quite pure, in that it doesn't clear existing environment variables. Has anyone come up with an approach that does clear the environment fully?

You typically put something like this in your .direnv file:

  eval "$(guix shell --search-paths --pure ...)"

While "guix shell --pure" clears environment variables except a few whitelisted ones like USER, here because of "--search-paths" the above approach just exports/overrides variables like PATH. For example, I still have variables like XDG_SESSION_TYPE in my environment.

It's general decent enough isolation between projects as-is, but I wondered if anyone has worked on this.

(CC'ing Oleg who wrote the Guix Cookbook chapter on direnv and Christopher who he credited with the approach.)

Regards,
Ben

Reply via email to