all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: George Clemmer <myglc2@gmail.com>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: How to "Use PROFILE instead of the user’s default profile."?
Date: Thu, 21 Jun 2018 12:41:58 +0200	[thread overview]
Message-ID: <878t78to95.fsf@elephly.net> (raw)
In-Reply-To: <87bmc4aoa8.fsf@gmail.com>


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

  parent reply	other threads:[~2018-06-21 10:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21  2:03 How to "Use PROFILE instead of the user’s default profile."? George Clemmer
2018-06-21  9:32 ` Tom Balzer
2018-06-21 10:41 ` Ricardo Wurmus [this message]
2018-06-21 14:01   ` George Clemmer
2018-06-21 14:08     ` Ricardo Wurmus
2018-06-21 14:56     ` George Clemmer
2018-06-21 15:59       ` Ricardo Wurmus
2018-06-21 16:52         ` George Clemmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878t78to95.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=help-guix@gnu.org \
    --cc=myglc2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.