guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Export environment variables only in `guix environment`.


From: Pjotr Prins
Subject: Re: Export environment variables only in `guix environment`.
Date: Fri, 2 Feb 2018 07:27:17 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Feb 01, 2018 at 06:26:57PM +0100, Chris Marusich wrote:
> Fis Trivial <address@hidden> writes:
> 
> > * Problem
> > The exported environment variables can cause various problems in foreign
> > distribution(1)(2). And besides, The long list of environment variables(4)
> > injected into user's login shell makes the user's environment impure.
> 
> A lot of software is intended to be dynamically composed with other
> software at run-time through the use of mechanisms like environment
> variables.  Other mechanisms of dynamic composition at run-time also
> exist, such as configuration files (e.g., ~/.emacs).  Consider the
> EDITOR environment variable, which is traditionally used to indicate the
> user's default text editor.  We COULD try to control the EDITOR
> environment variable with Guix, but then you would have to update your
> Guix profile every time you wanted to change your default text editor.
> It would be "more pure," but less convenient.

Exactly, we need to match what existing software expects. There is no
real way around that. Guix use of environment variables is 'limited'.
Take the list for a compilation with D, C, R, git and Python in the
profile you get:

./pre-inst-env guix package --search-paths -p ~/opt/ldc

generic:

  export PATH="/home/wrk/opt/ldc/bin:/home/wrk/opt/ldc/sbin"
  export XDG_DATA_DIRS="/home/wrk/opt/ldc/share"

Special:

  export CPATH="/home/wrk/opt/ldc/include"
  export LIBRARY_PATH="/home/wrk/opt/ldc/lib"
  export C_INCLUDE_PATH="/home/wrk/opt/ldc/include"
  export CPLUS_INCLUDE_PATH="/home/wrk/opt/ldc/include"
  export PYTHONPATH="/home/wrk/opt/ldc/lib/python2.7/site-packages"
  export GIT_EXEC_PATH="/home/wrk/opt/ldc/libexec/git-core"
  export R_LIBS_SITE="/home/wrk/opt/ldc/site-library/"
  export GUIX_GTK3_PATH="/home/wrk/opt/ldc/lib/gtk-3.0"
  export GI_TYPELIB_PATH="/home/wrk/opt/ldc/lib/girepository-1.0"
  export GIO_EXTRA_MODULES="/home/wrk/opt/ldc/lib/gio/modules"

All pretty clear and hardly a disaster. I don't set any of these by
default on login.

Main thing is to manage environment variables to match the
software. When you create a profile with only one package in it, the
use of environment settings will be limited to what the software
expects. 

There is no bleeding of variables into the environment unless you make
it to.

Pj.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]