all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to "Use PROFILE instead of the user’s default profile."?
@ 2018-06-21  2:03 George Clemmer
  2018-06-21  9:32 ` Tom Balzer
  2018-06-21 10:41 ` Ricardo Wurmus
  0 siblings, 2 replies; 8+ messages in thread
From: George Clemmer @ 2018-06-21  2:03 UTC (permalink / raw)
  To: help-guix

I am trying to understand and use Guix profiles. In (guix) Invoking guix
package it says ...

‘--profile=PROFILE’
‘-p PROFILE’
     Use PROFILE instead of the user’s default profile.

Because I want to use znc *instead* of the packages in my user’s default
profile, I did ...

guix package -p znc -i znc

... then I read this in znc/etc/profile ...

# Source this file to define all the relevant environment variables in Bash
# for this profile.  You may want to define the 'GUIX_PROFILE' environment
# variable to point to the "visible" name of the profile, like this:
#
#  GUIX_PROFILE=/path/to/profile ; \
#  source /path/to/profile/etc/profile

... so I did ...

GUIX_PROFILE=znc
source $GUIX_PROFILE/etc/profile

I expected 'which' now to find znc but not my user’s default profile
packages. Instead it finds znc *plus* my user’s default profile
packages.

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?

If so, how do I "Use my znc PROFILE *instead* of my user’s default
profile?"

TIA - George

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

* Re: How to "Use PROFILE instead of the user’s default profile."?
  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
  1 sibling, 0 replies; 8+ messages in thread
From: Tom Balzer @ 2018-06-21  9:32 UTC (permalink / raw)
  To: George Clemmer; +Cc: help-guix


> If so, how do I "Use my znc PROFILE *instead* of my user’s default
> profile?"

I asked this question in IRC some time back - the comand

$(guix package -p /path/to/profile --search-paths)

would replace the variables in your shell with those of the profile you
want.

--

Tom

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

* Re: How to "Use PROFILE instead of the user’s default profile."?
  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
  2018-06-21 14:01   ` George Clemmer
  1 sibling, 1 reply; 8+ messages in thread
From: Ricardo Wurmus @ 2018-06-21 10:41 UTC (permalink / raw)
  To: George Clemmer; +Cc: help-guix


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

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

* Re: How to "Use PROFILE instead of the user’s default profile."?
  2018-06-21 10:41 ` Ricardo Wurmus
@ 2018-06-21 14:01   ` George Clemmer
  2018-06-21 14:08     ` Ricardo Wurmus
  2018-06-21 14:56     ` George Clemmer
  0 siblings, 2 replies; 8+ messages in thread
From: George Clemmer @ 2018-06-21 14:01 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix


Ricardo Wurmus <rekado@elephly.net> writes:

> Hi George,
>
> 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.
...
>      This option can also be used to compute the _combined_ search paths
>      of several profiles.  Consider this example:
...
> --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.

Thanks Ricardo,

So, I can use PROFILE instead of my user default profile with ....

eval guix package -p /var/guix/profiles/system -p PROFILE --search-paths=exact

Is that correct?

TIA - George

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

* Re: How to "Use PROFILE instead of the user’s default profile."?
  2018-06-21 14:01   ` George Clemmer
@ 2018-06-21 14:08     ` Ricardo Wurmus
  2018-06-21 14:56     ` George Clemmer
  1 sibling, 0 replies; 8+ messages in thread
From: Ricardo Wurmus @ 2018-06-21 14:08 UTC (permalink / raw)
  To: George Clemmer; +Cc: help-guix


George Clemmer <myglc2@gmail.com> writes:

> So, I can use PROFILE instead of my user default profile with ....
>
> eval guix package -p /var/guix/profiles/system -p PROFILE --search-paths=exact

Note the backticks and the addition of “/profile”:

    eval `guix package -p /var/guix/profiles/system/profile -p PROFILE --search-paths=exact`

-- 
Ricardo

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

* Re: How to "Use PROFILE instead of the user’s default profile."?
  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
  1 sibling, 1 reply; 8+ messages in thread
From: George Clemmer @ 2018-06-21 14:56 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix


George Clemmer <myglc2@gmail.com> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> Hi George,
>>
>> 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.
> ...
>>      This option can also be used to compute the _combined_ search paths
>>      of several profiles.  Consider this example:
> ...
>> --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.
>
> Thanks Ricardo,
>
> So, I can use PROFILE instead of my user default profile with ....
>
> eval guix package -p /var/guix/profiles/system -p PROFILE
> --search-paths=exact

Oops, I left out the back quotes. I mean ...

eval `guix package -p /var/guix/profiles/system -p PROFILE
--search-paths=exact`

... because I understand the doc to say this will give the "_combined_
search paths" of the two profiles. But I am disappointed that ...

guix package -p znc -i znc
eval `guix package -p /var/guix/profiles/system -p znc --search-paths`

... provides znc but no system packages. What am I misunderstanding now?

TIA - George

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

* Re: How to "Use PROFILE instead of the user’s default profile."?
  2018-06-21 14:56     ` George Clemmer
@ 2018-06-21 15:59       ` Ricardo Wurmus
  2018-06-21 16:52         ` George Clemmer
  0 siblings, 1 reply; 8+ messages in thread
From: Ricardo Wurmus @ 2018-06-21 15:59 UTC (permalink / raw)
  To: George Clemmer; +Cc: help-guix


George Clemmer <myglc2@gmail.com> writes:

> Oops, I left out the back quotes. I mean ...
>
> eval `guix package -p /var/guix/profiles/system -p PROFILE
> --search-paths=exact`
>
> ... because I understand the doc to say this will give the "_combined_
> search paths" of the two profiles. But I am disappointed that ...
>
> guix package -p znc -i znc
> eval `guix package -p /var/guix/profiles/system -p znc --search-paths`
>
> ... provides znc but no system packages. What am I misunderstanding now?

I replied earlier that the path to your system profile is incomplete.
It should be 

    /var/guix/profiles/system/profile

but you wrote

    /var/guix/profiles/system

-- 
Ricardo

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

* Re: How to "Use PROFILE instead of the user’s default profile."?
  2018-06-21 15:59       ` Ricardo Wurmus
@ 2018-06-21 16:52         ` George Clemmer
  0 siblings, 0 replies; 8+ messages in thread
From: George Clemmer @ 2018-06-21 16:52 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix


Ricardo Wurmus <rekado@elephly.net> writes:

> George Clemmer <myglc2@gmail.com> writes:
>
>> Oops, I left out the back quotes. I mean ...
>>
>> eval `guix package -p /var/guix/profiles/system -p PROFILE
>> --search-paths=exact`
>>
>> ... because I understand the doc to say this will give the "_combined_
>> search paths" of the two profiles. But I am disappointed that ...
>>
>> guix package -p znc -i znc
>> eval `guix package -p /var/guix/profiles/system -p znc --search-paths`
>>
>> ... provides znc but no system packages. What am I misunderstanding now?
>
> I replied earlier that the path to your system profile is incomplete.
> It should be
>
>     /var/guix/profiles/system/profile
>
> but you wrote
>
>     /var/guix/profiles/system

Yes I noticed, thank you. Sorry about the crossed emacs. - George

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

end of thread, other threads:[~2018-06-21 17:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.