From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Darrington Subject: [PATCH] $HOME/.guix-profile considered harmful. Date: Mon, 12 Sep 2016 20:18:19 +0200 Message-ID: <1473704299-8703-1-git-send-email-jmd@gnu.org> 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]:37081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjVoP-0006Kr-59 for guix-devel@gnu.org; Mon, 12 Sep 2016 14:18:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjVoL-0003Ew-03 for guix-devel@gnu.org; Mon, 12 Sep 2016 14:18:33 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Cc: John Darrington I have my /home NFS mounted (not uncommon in large networks, I think). Unfortunately this does not play nicely with guix's convention of setting $PATH &c to $HOME/.guix-profile and then linking $HOME/.guix-profile to %state-directory/profiles/per-user/$USER/guix_profile - for the obvious r= eason that %state-directory could be different on each workstation - in which c= ase $HOME/.guix-profile will be a dead link. I'm not sure exactly what benefit the ~/.guix-profile convention brings u= s, except perhaps that it is easy to remember. I'd like to see the ability to have GuixSD deployable in medium-large int= ranets where home (and /var/mail) are remotely mounted filesystems. Hence I sug= gest that $HOME/.guix-profile is deprecated. The following patch fixes part of the problem on my system. --- gnu/system.scm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 7edb018..dbdb2f6 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2013, 2014, 2015, 2016 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2015 Mark H Weaver ;;; Copyright =C2=A9 2015, 2016 Alex Kost +;;; Copyright =C2=A9 2016 John Darrington ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,6 +27,7 @@ #:use-module (guix packages) #:use-module (guix derivations) #:use-module (guix profiles) + #:use-module (guix config) #:use-module (guix ui) #:use-module (gnu packages base) #:use-module (gnu packages bash) @@ -405,14 +407,15 @@ directory." =20 ;; Startup file for POSIX-compliant login shells, which set syst= em-wide ;; environment variables. - (profile (mixed-text-file "profile" "\ + (profile (mixed-text-file "profile" (format #f "\ # Crucial variables that could be missing in the profiles' 'etc/profile' # because they would require combining both profiles. # FIXME: See . -export MANPATH=3D$HOME/.guix-profile/share/man:/run/current-system/profi= le/share/man -export INFOPATH=3D$HOME/.guix-profile/share/info:/run/current-system/pro= file/share/info -export XDG_DATA_DIRS=3D$HOME/.guix-profile/share:/run/current-system/pro= file/share -export XDG_CONFIG_DIRS=3D$HOME/.guix-profile/etc/xdg:/run/current-system= /profile/etc/xdg +guix_profile=3D~a/profiles/per-user/$USER/guix-profile +export MANPATH=3D$guix_profile/share/man:/run/current-system/profile/sha= re/man +export INFOPATH=3D$guix_profile/share/info:/run/current-system/profile/s= hare/info +export XDG_DATA_DIRS=3D$guix_profile/share:/run/current-system/profile/s= hare +export XDG_CONFIG_DIRS=3D$guix_profile/etc/xdg:/run/current-system/profi= le/etc/xdg =20 # Ignore the default value of 'PATH'. unset PATH @@ -435,15 +438,15 @@ then export `cat /etc/environment | cut -d=3D -f1` fi =20 -if [ -f \"$HOME/.guix-profile/etc/profile\" ] +if [ -f \"$guix_profile/etc/profile\" ] then # Load the user profile's settings. - GUIX_PROFILE=3D\"$HOME/.guix-profile\" \\ - . \"$HOME/.guix-profile/etc/profile\" + GUIX_PROFILE=3D\"$guix_profile\" \\ + . \"$guix_profile/etc/profile\" else # At least define this one so that basic things just work # when the user installs their first package. - export PATH=3D\"$HOME/.guix-profile/bin:$PATH\" + export PATH=3D\"$guix_profile/bin:$PATH\" fi =20 # Set the umask, notably for users logging in via 'lsh'. @@ -451,14 +454,14 @@ fi umask 022 =20 # Allow GStreamer-based applications to find plugins. -export GST_PLUGIN_PATH=3D\"$HOME/.guix-profile/lib/gstreamer-1.0\" +export GST_PLUGIN_PATH=3D\"$guix_profile/lib/gstreamer-1.0\" =20 if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ] then # Load Bash-specific initialization code. . /etc/bashrc fi -")) +" %state-directory))) =20 (bashrc (plain-file "bashrc" "\ # Bash-specific initialization. --=20 2.1.4