[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to "Use PROFILE instead of the user’s default profile."?
From: |
Ricardo Wurmus |
Subject: |
Re: How to "Use PROFILE instead of the user’s default profile."? |
Date: |
Thu, 21 Jun 2018 12:41:58 +0200 |
User-agent: |
mu4e 1.0; emacs 26.1 |
Hi George,
> So it looks like I am using the "union" of the znc and user’s default
> profiles as opposed to using the znc PROFILE *instead* of the user’s
> default profile.
>
> Is that a correct understanding of what is happening? Is that how it is
> supposed to work?
You understand correctly and this is how it is supposed to work. The
“source” method always augments the environment variables.
> If so, how do I "Use my znc PROFILE *instead* of my user’s default
> profile?"
You can use “guix package --search-paths=KIND” to generate different
kinds of environment variable changes. The manual says this:
--8<---------------cut here---------------start------------->8---
‘--search-paths[=KIND]’
Report environment variable definitions, in Bash syntax, that may
be needed in order to use the set of installed packages. These
environment variables are used to specify “search paths” for files
used by some of the installed packages.
For example, GCC needs the ‘CPATH’ and ‘LIBRARY_PATH’ environment
variables to be defined so it can look for headers and libraries in
the user’s profile (*note (gcc)Environment Variables::). If GCC
and, say, the C library are installed in the profile, then
‘--search-paths’ will suggest setting these variables to
‘PROFILE/include’ and ‘PROFILE/lib’, respectively.
The typical use case is to define these environment variables in
the shell:
$ eval `guix package --search-paths`
KIND may be one of ‘exact’, ‘prefix’, or ‘suffix’, meaning that the
returned environment variable definitions will either be exact
settings, or prefixes or suffixes of the current value of these
variables. When omitted, KIND defaults to ‘exact’.
This option can also be used to compute the _combined_ search paths
of several profiles. Consider this example:
$ guix package -p foo -i guile
$ guix package -p bar -i guile-json
$ guix package -p foo -p bar --search-paths
The last command above reports about the ‘GUILE_LOAD_PATH’
variable, even though, taken individually, neither ‘foo’ nor ‘bar’
would lead to that recommendation.
--8<---------------cut here---------------end--------------->8---
Note that using “exact” overrides variables, which means that you would
end up without things you might take for granted, such as “/bin” or
“/run/current-system/profile/bin”.
The behaviour of sourcing a profile’s “etc/profile” file is equivalent
to using
eval `guix package --search-paths=prefix`
We wanted to add a more convenient command to “enable” another profile,
but IIRC there was no consensus on what that would look like.
--
Ricardo
Re: How to "Use PROFILE instead of the user’s default profile."?, Tom Balzer, 2018/06/21