From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: "The following environment variable definitions may be needed" Date: Wed, 10 May 2017 09:19:11 +0000 Message-ID: <20170510091911.d2m3hun4v35mdezk@abyayala> References: <87lgq5p8al.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8OC7-0008A3-1M for help-guix@gnu.org; Wed, 10 May 2017 05:46:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8OC2-0006yU-1V for help-guix@gnu.org; Wed, 10 May 2017 05:46:07 -0400 Received: from 93-95-228-241.1984.is ([93.95.228.241]:53110 helo=sharknado9001.pragmatique.xyz) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d8OC1-0006wP-KX for help-guix@gnu.org; Wed, 10 May 2017 05:46:01 -0400 Content-Disposition: inline In-Reply-To: <87lgq5p8al.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: Chris Marusich Cc: help-guix@gnu.org Chris Marusich transcribed 2.9K bytes: > Hi, > > Sometimes, when you install a package, you get a message like this: > > --8<---------------cut here---------------start------------->8--- > [0] marusich@garuda:/tmp > $ guix package -p test-profile -i guile > The following package will be installed: > guile 2.2.2 /gnu/store/5zx29y44nrqj0s8h3jlvlj82k8hj4dxs-guile-2.2.2 > > 1 package in profile > The following environment variable definitions may be needed: > export PATH="test-profile/bin${PATH:+:}$PATH" > [0] marusich@garuda:/tmp > $ > --8<---------------cut here---------------end--------------->8--- > > Up until now, I've always added the recommended export statements to my > ~/.bashrc or ~/.bash_profile. I (mistakenly?) assumed that's what the > message was really telling me to do. However, I've just learned that > these recommended variables also appear to get exported in > $GUIX_PROFILE/etc/profile, which is automatically sourced by > /etc/profile on GuixSD. Even on a foreign distro, > $GUIX_PROFILE/etc/profile is automatically sourced if one follows the > guidance in the manual ((guix) Binary Installation): > > --8<---------------cut here---------------start------------->8--- > Source ‘etc/profile’ to augment ‘PATH’ and other relevant > environment variables: > > # GUIX_PROFILE=$HOME/.guix-profile \ > source $GUIX_PROFILE/etc/profile > --8<---------------cut here---------------end--------------->8--- > > This leads to my question: If I'm using GuixSD (or a foreign distro in > which $GUIX_PROFILE/etc/profile is automatically sourced), do I need to > add these recommended export statements to my ~/.bashrc or > ~/.bash_profile? > > My suspicion is that the answer is "no". The next time I reboot or log > out and back in, the environment variables will be set correctly even if > I don't add them to my ~/.bashrc or ~/.bash_profile. In fact, by adding > them there, I would be adding redundant entries. I am hoping that > someone can confirm that my understanding is correct. > > -- > Chris on GuixSD with my bash using user, I do this in $HOME/.bash_profile: source $HOME/.guix-profile/etc/profile You do not have to have the entry twice in your shell related files. You could just issue the command in bash after you installed something, type "source ~/.guix-profile/etc/profile" and your variables will be updated. (I write explicitly bash because we could do better and enable users of all shells to get the right variables from the start. I'm currently thinking about an solution here.) -- https://pragmatique.xyz PGP: https://people.pragmatique.xyz/ng0/