all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#53447] [PATCH] doc: Unset environment variables considered harmful
@ 2022-01-22 14:13 Liliana Marie Prikler
  2022-01-22 16:04 ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Liliana Marie Prikler @ 2022-01-22 14:13 UTC (permalink / raw)
  To: 53447

* doc/guix.texi (Application Setup): Add subsection for implicit environment
variables.
---
 doc/guix.texi | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 912a8e3c5a..805e3b611f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2023,6 +2023,33 @@ want to avoid auto-loading the Emacs packages installed with Guix, you
 can do so by running Emacs with the @option{--no-site-file} option
 (@pxref{Init File,,, emacs, The GNU Emacs Manual}).
 
+@subsection Implicit Environment Variables
+
+Many environment variables are defined in a way that assumes a certain
+default value, even if unset.  For example, bash uses the current
+working directory as @env{PATH} if unset, or @env{XDG_CONFIG_HOME}
+expands to @file{$HOME/.config}.  Some of these defaults remain the same
+whether a package is used through Guix or not---however, environment
+variables referring to @file{/etc} or @file{/usr} typically have their
+meaning subtly changed in Guix.  An application installed via Guix might
+instead look up files in its own @file{etc} structure, or (if a
+search-path was specified) even override the default for packages from
+the foreign distro.
+
+In order to avoid problems coming from such implicitly defined
+environment variables, it is best to explicitly define them somewhere.
+Startup files like @file{~/.bash_profile} are usually a good location
+to do so.  However, not all setups treat them equally.  While on Guix
+System, the user's login shell is used to spawn a graphical session,
+other distros may choose a different approach.  For instance, systemd
+is capable of spawning graphical applications in a clean environment,
+but allows said environments to be modified through an
+@file{override.conf} placed in the right directory.
+
+Regardless of which method is used to set such environment variables,
+they typically should only be set once at login.  Placing them in files
+like @file{~/.bashrc} or similar has adverse effects on other commands
+that want to create clean environments, such as @command{guix shell}.
 
 @node Upgrading Guix
 @section Upgrading Guix
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-01-27  4:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22 14:13 [bug#53447] [PATCH] doc: Unset environment variables considered harmful Liliana Marie Prikler
2022-01-22 16:04 ` Ludovic Courtès
2022-01-22 17:53   ` Liliana Marie Prikler
2022-01-24 22:27     ` Maxim Cournoyer
2022-01-25 13:29       ` [bug#53447] Introducing ‘GUIX_’-prefixed environment variables Ludovic Courtès
2022-01-26  1:56         ` Maxim Cournoyer
2022-01-26 12:05           ` Ludovic Courtès
2022-01-26 20:03             ` Liliana Marie Prikler
2022-01-27  4:53               ` Maxim Cournoyer
2022-01-25  7:39     ` [bug#53447] [PATCH] doc: Unset environment variables considered harmful Ludovic Courtès
2022-01-25 19:21       ` Liliana Marie Prikler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.