From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: How to "Use PROFILE instead of the =?utf-8?Q?user=E2=80=99s?= default profile."? Date: Thu, 21 Jun 2018 12:41:58 +0200 Message-ID: <878t78to95.fsf@elephly.net> References: <87bmc4aoa8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVx2g-0003hc-7N for help-guix@gnu.org; Thu, 21 Jun 2018 06:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVx2d-0003IQ-4k for help-guix@gnu.org; Thu, 21 Jun 2018 06:42:18 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fVx2c-0003Hw-OZ for help-guix@gnu.org; Thu, 21 Jun 2018 06:42:15 -0400 In-reply-to: <87bmc4aoa8.fsf@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: George Clemmer Cc: help-guix Hi George, > So it looks like I am using the "union" of the znc and user=E2=80=99s def= ault > profiles as opposed to using the znc PROFILE *instead* of the user=E2=80= =99s > 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 =E2=80=9Csource=E2=80=9D method always augments the environment variables. > If so, how do I "Use my znc PROFILE *instead* of my user=E2=80=99s default > profile?" You can use =E2=80=9Cguix package --search-paths=3DKIND=E2=80=9D to generat= e different kinds of environment variable changes. The manual says this: --8<---------------cut here---------------start------------->8--- =E2=80=98--search-paths[=3DKIND]=E2=80=99 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 =E2=80=9Csearch paths=E2=80= =9D for files used by some of the installed packages. For example, GCC needs the =E2=80=98CPATH=E2=80=99 and =E2=80=98LIBRAR= Y_PATH=E2=80=99 environment variables to be defined so it can look for headers and libraries in the user=E2=80=99s profile (*note (gcc)Environment Variables::). If G= CC and, say, the C library are installed in the profile, then =E2=80=98--search-paths=E2=80=99 will suggest setting these variables = to =E2=80=98PROFILE/include=E2=80=99 and =E2=80=98PROFILE/lib=E2=80=99, r= espectively. The typical use case is to define these environment variables in the shell: $ eval `guix package --search-paths` KIND may be one of =E2=80=98exact=E2=80=99, =E2=80=98prefix=E2=80=99, = or =E2=80=98suffix=E2=80=99, 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 =E2=80=98exact=E2=80=99. 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 =E2=80=98GUILE_LOAD_PATH=E2= =80=99 variable, even though, taken individually, neither =E2=80=98foo=E2=80= =99 nor =E2=80=98bar=E2=80=99 would lead to that recommendation. --8<---------------cut here---------------end--------------->8--- Note that using =E2=80=9Cexact=E2=80=9D overrides variables, which means th= at you would end up without things you might take for granted, such as =E2=80=9C/bin=E2= =80=9D or =E2=80=9C/run/current-system/profile/bin=E2=80=9D. The behaviour of sourcing a profile=E2=80=99s =E2=80=9Cetc/profile=E2=80=9D= file is equivalent to using eval `guix package --search-paths=3Dprefix` We wanted to add a more convenient command to =E2=80=9Cenable=E2=80=9D anot= her profile, but IIRC there was no consensus on what that would look like. -- Ricardo