GNU bug report logs - #77035
[PATCH 0/2] home: setup-environment: Avoid prepending duplicated PATH.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Hilton Chain <hako@HIDDEN>; Keywords: patch; merged with #77522, #77523, #77524, #77525, #77526, #77527, #77528; dated Sat, 15 Mar 2025 13:24:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Merged 77035 77522 77523 77524 77525 77526 77527 77528. Request was from Hilton Chain <hako@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:04:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 11:04:10 2025
Received: from localhost ([127.0.0.1]:50042 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzd9u-0004DK-2N
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:04:10 -0400
Received: from mx.boiledscript.com ([2a01:4f8:10b:392::42]:59012)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzd9r-0004CT-MF
 for 77035 <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:04:08 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743519844;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=P17vRpevmYS3yqSd0QeZRelC8Qv6dsRoXvXGfCNVjs4=;
 b=Yh/8fi7CDBG30CB+khY4Szzu34NrCiIc6qj4rizfa5N9ExGFjku+b1jLg18X7Zo2KGJinJ
 XcI9EHvRVQZLIW11YO/F103J8tAu0ZgrMNyIIOEwa6A+2Ovby8kn+ElZokHCtWHly/XUXE
 Eb8wod5Wy6uEagtIAmPWPNo/cRJgi5GMgOp/n+m/REr83poRrkHioZLNWatMaYuqEdJeQn
 5fqVzFrM/PxhC7kJoJPoDffk11dtwZLNThRC2M9/1gzljFsRNVSqHAW/IchH21GbRum8wg
 vqYwsJnjEZRBwgq0GMdvTpFjahdS4yYhaQaFQf17vke/2xbHvgV2Ol2oMuoxgw==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v3 5/5] guix-install.sh: Set up all default profiles in one
 iteration.
Date: Tue,  1 Apr 2025 23:02:48 +0800
Message-ID: <b2e1f5656e61637601b55436defe831d2eb91ff6.1743519525.git.hako@HIDDEN>
In-Reply-To: <cover.1743519525.git.hako@HIDDEN>
References: <cover.1743519525.git.hako@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* etc/guix-install.sh (sys_create_init_profile): Merge settings into one
iteration.
Set up extra environment variables for Guix Home.

Change-Id: Ia443b78a5ba656b7d03e1abbba53c4bf1240e338
---
 etc/guix-install.sh | 71 ++++++++++++++++++++++++---------------------
 1 file changed, 38 insertions(+), 33 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index b5d833cd64..5fd9e4690d 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -749,47 +749,52 @@ export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}"
 export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
 # no default for XDG_RUNTIME_DIR (depends on foreign distro for semantics)
 
-# `guix pull` profile
-GUIX_PROFILE="$HOME/.config/guix/current"
-export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH"
-# Add to INFOPATH and MANPATH so the latest Guix documentation is available to
-# info and man readers.  When INFOPATH is unset, add a trailing colon so Emacs
-# searches 'Info-default-directory-list'.  When MANPATH is unset, add a
-# trailing colon so the system default search path is used.
-export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH"
-export MANPATH="$GUIX_PROFILE/share/man:$MANPATH"
-# Expose the latest Guix modules to Guile so guix shell and repls spawned by
-# e.g. Geiser work out of the box.
-export GUILE_LOAD_PATH="$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
-export GUILE_LOAD_COMPILED_PATH="$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
-
-# User's default profile, if it exists
-GUIX_PROFILE="$HOME/.guix-profile"
-if [ -L "$GUIX_PROFILE" ]; then
-  . "$GUIX_PROFILE/etc/profile"
-
-  # see info '(guix) Application Setup'
-  export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH"
-
-  # Documentation search paths may be handled by $GUIX_PROFILE/etc/profile if
-  # the user installs info and man readers via Guix.  If the user doesn’t,
-  # explicitly add to them so documentation for software from ‘guix install’
-  # is available to the system info and man readers.
+# Set up environment for all default profiles.
+for GUIX_PROFILE in "$HOME/.guix-home/profile" \
+                    "$HOME/.guix-profile" \
+                    "$HOME/.config/guix/current"
+do
+  if [ -f "$GUIX_PROFILE/etc/profile" ]; then
+    . "$GUIX_PROFILE/etc/profile"
+  fi
+  # See info '(guix) Application Setup'.
+  case $GUIX_LOCPATH in
+    *GUIX_PROFILE/lib/locale*) ;;
+    *) export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH" ;;
+  esac
+  # Make basic things just work when the user installs their first package.
+  case $PATH in
+    *$GUIX_PROFILE/bin*) ;;
+    *) export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH" ;;
+  esac
+  # Add to INFOPATH and MANPATH so the latest Guix documentation is available to
+  # info and man readers.  When INFOPATH is unset, add a trailing colon so Emacs
+  # searches 'Info-default-directory-list'.  When MANPATH is unset, add a
+  # trailing colon so the system default search path is used.
   case $INFOPATH in
     *$GUIX_PROFILE/share/info*) ;;
     *) export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH" ;;
   esac
   case $MANPATH in
     *$GUIX_PROFILE/share/man*) ;;
-    *) export MANPATH="$GUIX_PROFILE/share/man:$MANPATH"
+    *) export MANPATH="$GUIX_PROFILE/share/man:$MANPATH" ;;
   esac
-fi
-
-# NOTE: Guix Home handles its own profile initialization in ~/.profile. See
-# info '(guix) Configuring the Shell'.
+  # Expose Guix modules to Guile so guix shell and repls spawned by e.g. Geiser
+  # work out of the box.
+  case $GUILE_LOAD_PATH in
+    *$GUIX_PROFILE/share/guile/site/3.0*) ;;
+    *) export GUILE_LOAD_PATH="$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" ;;
+  esac
+  case $GUILE_LOAD_COMPILED_PATH in
+    *$GUIX_PROFILE/lib/guile/3.0/site-ccache*) ;;
+    *) export GUILE_LOAD_COMPILED_PATH="$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" ;;
+  esac
+done
 
-# Clean up after ourselves.
-unset GUIX_PROFILE
+# Set up extra environment variables for Guix Home.
+HOME_ENVIRONMENT=$HOME/.guix-home
+[ -f "$HOME_ENVIRONMENT/setup-environment" ] && . "$HOME_ENVIRONMENT/setup-environment"
+unset HOME_ENVIRONMENT
 EOF
 }
 
-- 
2.49.0





Information forwarded to hako@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:04:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 11:04:03 2025
Received: from localhost ([127.0.0.1]:50028 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzd9n-0004Bu-5j
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:04:03 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:37150)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzd9l-0004BK-3T
 for 77035 <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:04:02 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743519840;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=7XMI5drsteA7hQ1Jxg/umGkusBC47mbOclwLtcEHlM4=;
 b=B0sZa+4mdZdWQZW8xsVwZAOOIlcNe5nxhffl474yqLHgQzpOhQwPuAghGIOJx2HR+wSIMM
 WITVqIyuuznH//6TVnFQoxs8RCXgBbV1Tq9FIjxTDiFstAQjEWAhIWtBIj9L0aPP8wTxDc
 1jx4noWcWTJuE5qYduTQiyabknrCyhM1lx+BzCNegdIrvckFlzKe6btcOiGCBBX9VtsGSB
 6lfwaNHLEUJHXo0NTuzoTe20Skc5SfV7gqGOvbXcx4zZ4LGCQVPLJBF/ZTiD3AaV6FbWdL
 pph1lcJqfiQUMgCItZ0JKvweqjOupSiuyZU95G03NzUVKUj9pti7GU56lnxlzA==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v3 4/5] =?UTF-8?q?system=20&=20home:=20profile:=20Address?=
 =?UTF-8?q?=20issues=20reported=20by=20=E2=80=98shellcheck=E2=80=99.?=
Date: Tue,  1 Apr 2025 23:02:47 +0800
Message-ID: <10b0b9c1044b1ccc0954d902e9a4436e82a0a964.1743519525.git.hako@HIDDEN>
In-Reply-To: <cover.1743519525.git.hako@HIDDEN>
References: <cover.1743519525.git.hako@HIDDEN>
MIME-Version: 1.0
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Andrew Tropin <andrew@HIDDEN>, Janneke Nieuwenhuizen <janneke@HIDDEN>, Tanguy Le Carrour <tanguy@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/system.scm (operating-system-etc-service)[profile]: Address issues
reported by ‘shellcheck’.
* gnu/home/services.scm (environment-variables->setup-environment-script):
Likewise.
* gnu/home/services/shells.scm (add-shell-profile-file): Likewise.

Change-Id: I4e230fd239b8a8450da6ee0c2e58746c9cc38785
---
 gnu/home/services.scm        | 16 ++++++++++------
 gnu/home/services/shells.scm |  4 ++--
 gnu/system.scm               | 10 +++++-----
 3 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 6be1a49a90..769bc1c033 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -287,27 +287,31 @@ (define (environment-variables->setup-environment-script vars)
 
 case $GUIX_LOCPATH in
   *$GUIX_PROFILE/lib/locale*) ;;
-  *) export GUIX_LOCPATH=$GUIX_PROFILE/lib/locale:$GUIX_LOCPATH ;;
+  *) export GUIX_LOCPATH=\"$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH\" ;;
 esac
 case $XDG_DATA_DIRS in
   *$GUIX_PROFILE/share*) ;;
-  *) export XDG_DATA_DIRS=$GUIX_PROFILE/share:$XDG_DATA_DIRS ;;
+  *) export XDG_DATA_DIRS=\"$GUIX_PROFILE/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS\" ;;
 esac
+# When MANPATH is unset, add a trailing colon so the system default search path
+# is used.
 case $MANPATH in
   *$GUIX_PROFILE/share/man*) ;;
-  *) export MANPATH=$GUIX_PROFILE/share/man:$MANPATH
+  *) export MANPATH=\"$GUIX_PROFILE/share/man:$MANPATH\" ;;
 esac
+# When INFOPATH is unset, add a trailing colon so Emacs searches
+# 'Info-default-directory-list'.
 case $INFOPATH in
   *$GUIX_PROFILE/share/info*) ;;
-  *) export INFOPATH=$GUIX_PROFILE/share/info:$INFOPATH ;;
+  *) export INFOPATH=\"$GUIX_PROFILE/share/info:$INFOPATH\" ;;
 esac
 case $XDG_CONFIG_DIRS in
   *$GUIX_PROFILE/etc/xdg*) ;;
-  *) export XDG_CONFIG_DIRS=$GUIX_PROFILE/etc/xdg:$XDG_CONFIG_DIRS ;;
+  *) export XDG_CONFIG_DIRS=\"$GUIX_PROFILE/etc/xdg${XDG_CONFIG_DIRS:+:}$XDG_CONFIG_DIRS\" ;;
 esac
 case $XCURSOR_PATH in
   *$GUIX_PROFILE/share/icons*) ;;
-  *) export XCURSOR_PATH=$GUIX_PROFILE/share/icons:$XCURSOR_PATH ;;
+  *) export XCURSOR_PATH=\"$GUIX_PROFILE/share/icons${XCURSOR_PATH:+:}$XCURSOR_PATH\" ;;
 esac
 
 # Keep the shell environment clean.
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index 35c0c52a8e..97c9331e18 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -87,13 +87,13 @@ (define (add-shell-profile-file config)
      ,(mixed-text-file
        "shell-profile"
        "\
-HOME_ENVIRONMENT=$HOME/.guix-home
+HOME_ENVIRONMENT=\"$HOME/.guix-home\"
 # Skip if already sourced.
 case $INFOPATH in
   *$HOME_ENVIRONMENT/profile/share/info*) ;;
   *) . \"$HOME_ENVIRONMENT/setup-environment\" ;;
 esac
-$HOME_ENVIRONMENT/on-first-login
+\"$HOME_ENVIRONMENT/on-first-login\"
 unset HOME_ENVIRONMENT\n"
        (serialize-configuration
         config
diff --git a/gnu/system.scm b/gnu/system.scm
index 71464bb712..bbf2f2afd3 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1071,11 +1071,11 @@ (define* (operating-system-etc-service os)
 # loaded when someone logs in via SSH.  See <http://bugs.gnu.org/22175>.
 # We need 'PATH' to be defined here, for 'cat' and 'cut'.  Do this before
 # reading the user's 'etc/profile' to allow variables to be overridden.
-if [ -f /etc/environment -a -n \"$SSH_CLIENT\" \\
-     -a -z \"$LINUX_MODULE_DIRECTORY\" ]
+if [ -f /etc/environment ] && [ -n \"$SSH_CLIENT\" ] &&
+     [ -z \"$LINUX_MODULE_DIRECTORY\" ]
 then
   . /etc/environment
-  export `/run/current-system/profile/bin/cut -d= -f1 < /etc/environment`
+  export \"$(/run/current-system/profile/bin/cut -d= -f1 < /etc/environment)\"
 fi
 
 # Set up environment for all default profiles.
@@ -1152,10 +1152,10 @@ (define* (operating-system-etc-service os)
 unset HOME_ENVIRONMENT
 
 # Prepend paths not in a profile.
-export PATH=/run/privileged/bin:$PATH
+export PATH=\"/run/privileged/bin:$PATH\"
 export XCURSOR_PATH=\"$HOME/.icons:$XCURSOR_PATH\"
 
-if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
+if [ -n \"$BASH_VERSION\" ] && [ -f /etc/bashrc ]
 then
   # Load Bash-specific initialization code.
   . /etc/bashrc
-- 
2.49.0





Information forwarded to hako@HIDDEN, ludo@HIDDEN, andrew@HIDDEN, janneke@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:04:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 11:04:00 2025
Received: from localhost ([127.0.0.1]:50022 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzd9j-0004BC-Jb
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:04:00 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:37146)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzd9h-0004Al-5q
 for 77035 <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:03:57 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743519835;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=lzE75rlE4EQDTJpvRSS+cLdyMuty8wZaVWM0MKTRSQ0=;
 b=AFxOJ52qwqd5uz1Uwdtx758ilfjPzMReXUozfKN2v6nvk5z8PZ98hPuL1RCDNFJvsKlkvz
 +BL2YfBn3CGC9gRiUr2DIoW/v1kqalDJujDVEOxFxdvXvyNFZfS1N1uzX5zlQGSG38EVXE
 zSghvxpGYzxI+7a0eL2v0K1Kgw/3CZV+DO75sJUhmeTTG2FZamTKYv0FZiBwyIYl1GsWyH
 Ai3eyBdau/gPyVjmWdFQcPmVfQrrPTJ1o4n6fHfg38xbvpJgwhKWJioeksjel5uwV5+Duk
 CuFyCgwfvXEs+XLivMrRNChAfp5ZJXuFqSTRi4KsO7ISGyzSJGwvaPqpE5hNWg==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v3 3/5] system: /etc/profile: Set up extra environment
 variables for Guix Home.
Date: Tue,  1 Apr 2025 23:02:46 +0800
Message-ID: <b1b78cd811a2968c6d551b76d161b988fb422c28.1743519525.git.hako@HIDDEN>
In-Reply-To: <cover.1743519525.git.hako@HIDDEN>
References: <cover.1743519525.git.hako@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Andrew Tropin <andrew@HIDDEN>, Janneke Nieuwenhuizen <janneke@HIDDEN>, Tanguy Le Carrour <tanguy@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/system.scm (operating-system-etc-service)[profile]: Set up extra
environment variables for Guix Home.
* gnu/home/services/shells.scm (add-shell-profile-file): Skip
setup-environment if already finished.
* gnu/home/services.scm (environment-variables->setup-environment-script):
Skip initializing home profile if already finished.

Change-Id: Ife4100c6b19f61272525eebc82931c81784fe9e0
---
 gnu/home/services.scm        | 6 +++++-
 gnu/home/services/shells.scm | 6 +++++-
 gnu/system.scm               | 5 +++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 85a43f80ca..6be1a49a90 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -279,7 +279,11 @@ (define (environment-variables->setup-environment-script vars)
 # ~/.profile does)
 GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\"
 PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\"
-[ -f $PROFILE_FILE ] && . $PROFILE_FILE
+# Skip if already initialized.
+case $INFOPATH in
+  *$GUIX_PROFILE/share/info*) ;;
+  *) [ -f \"$PROFILE_FILE\" ] && . \"$PROFILE_FILE\" ;;
+esac
 
 case $GUIX_LOCPATH in
   *$GUIX_PROFILE/lib/locale*) ;;
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index bab5730c3d..35c0c52a8e 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -88,7 +88,11 @@ (define (add-shell-profile-file config)
        "shell-profile"
        "\
 HOME_ENVIRONMENT=$HOME/.guix-home
-. $HOME_ENVIRONMENT/setup-environment
+# Skip if already sourced.
+case $INFOPATH in
+  *$HOME_ENVIRONMENT/profile/share/info*) ;;
+  *) . \"$HOME_ENVIRONMENT/setup-environment\" ;;
+esac
 $HOME_ENVIRONMENT/on-first-login
 unset HOME_ENVIRONMENT\n"
        (serialize-configuration
diff --git a/gnu/system.scm b/gnu/system.scm
index 9fb4275b45..71464bb712 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1146,6 +1146,11 @@ (define* (operating-system-etc-service os)
   esac
 done
 
+# Set up extra environment variables for Guix Home.
+HOME_ENVIRONMENT=\"$HOME/.guix-home\"
+[ -f \"$HOME_ENVIRONMENT/setup-environment\" ] && . \"$HOME_ENVIRONMENT/setup-environment\"
+unset HOME_ENVIRONMENT
+
 # Prepend paths not in a profile.
 export PATH=/run/privileged/bin:$PATH
 export XCURSOR_PATH=\"$HOME/.icons:$XCURSOR_PATH\"
-- 
2.49.0





Information forwarded to hako@HIDDEN, ludo@HIDDEN, andrew@HIDDEN, janneke@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:03:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 11:03:56 2025
Received: from localhost ([127.0.0.1]:50018 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzd9f-0004Aj-UH
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:03:56 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:58954)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzd9b-0004A5-Sm
 for 77035 <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:03:52 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743519830;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=6XZY0UxXtrqDwpAwWtGpj7IGxWacYvVcVdj1piY/gr8=;
 b=UxyH3vOzSV7LTKZh/KSdG8Yp7quwtVk5a525VN19oVMuSZHsOKLH/cH1/p2WHcMYhKtt0l
 ih7nvSAzXD8+r9iok2MkwPWjds7LL2WHna8rcC3e/GUVfo1kg6Hq7KGp3bCYMw26wVTnpr
 pEg61E4BC4HKFQdN1OWHWlIZVMe3KziB8jcYqVhlhDESbVPK8k1iA+19mZpQN9rUYXGzXx
 RhppTy7aSLsFezBpcqkIS8bvFtVCx6Gxn21onZ6pX9ueM5yLZEBwlZOiFUcymkkedB9WLJ
 UoyTT5XRYb01bD4wrF2Su+r7hN3xB9Ckk4EVyzlKhKgdEQ7fHqNMvD7Jr3ueUg==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v3 2/5] system: Rearrange /etc/profile.
Date: Tue,  1 Apr 2025 23:02:45 +0800
Message-ID: <61d3d34032d3dfcc71fff9f9e52093a65339065f.1743519525.git.hako@HIDDEN>
In-Reply-To: <cover.1743519525.git.hako@HIDDEN>
References: <cover.1743519525.git.hako@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/system.scm (operating-system-etc-service)[profile]: Set umask first.
Move extra environment variables setup into the iteration.
Add $GUILE_LOAD_PATH and $GUILE_LOAD_COMPILED_PATH.
* gnu/system/shadow.scm (%default-bash-profile): Remove duplicated exports.

Change-Id: I42ae153b9cd47ca24448fa18ce7f80a5e5c06621
---
 gnu/system.scm        | 90 +++++++++++++++++++++++++++++--------------
 gnu/system/shadow.scm | 10 -----
 2 files changed, 61 insertions(+), 39 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index c166222854..9fb4275b45 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1060,16 +1060,9 @@ (define* (operating-system-etc-service os)
         ;; Startup file for POSIX-compliant login shells, which set system-wide
         ;; environment variables.
         (profile    (mixed-text-file "profile"  "\
-# Crucial variables that could be missing in the profiles' 'etc/profile'
-# because they would require combining both profiles.
-# FIXME: See <http://bugs.gnu.org/20255>.
-export MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man
-export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info
-export XDG_DATA_DIRS=$HOME/.guix-profile/share:/run/current-system/profile/share
-export XDG_CONFIG_DIRS=$HOME/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg
-
-# Make sure libXcursor finds cursors installed into user or system profiles.  See <http://bugs.gnu.org/24445>
-export XCURSOR_PATH=$HOME/.icons:$HOME/.guix-profile/share/icons:/run/current-system/profile/share/icons
+# Set the umask, notably for users logging in via 'lsh'.
+# See <http://bugs.gnu.org/22650>.
+umask 022
 
 # Ignore the default value of 'PATH'.
 unset PATH
@@ -1094,29 +1087,68 @@ (define* (operating-system-etc-service os)
   if [ -f \"$GUIX_PROFILE/etc/profile\" ]
   then
     . \"$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=\"$GUIX_PROFILE/bin:$PATH\"
   fi
+  # At least define this one so that basic things just work when the user
+  # installs their first package.
+  case $PATH in
+    *$GUIX_PROFILE/bin*) ;;
+    *) export PATH=\"$GUIX_PROFILE/bin${PATH:+:}$PATH\" ;;
+  esac
+  # Crucial variables that could be missing in the profiles' 'etc/profile'
+  # because they would require combining both profiles.
+  # FIXME: See <http://bugs.gnu.org/20255>.
+  case $XDG_DATA_DIRS in
+    *$GUIX_PROFILE/share*) ;;
+    *) export XDG_DATA_DIRS=\"$GUIX_PROFILE/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS\" ;;
+  esac
+  case $XDG_CONFIG_DIRS in
+    *$GUIX_PROFILE/etc/xdg*) ;;
+    *) export XDG_CONFIG_DIRS=\"$GUIX_PROFILE/etc/xdg${XDG_CONFIG_DIRS:+:}$XDG_CONFIG_DIRS\" ;;
+  esac
+  # When INFOPATH is unset, add a trailing colon so Emacs searches
+  # 'Info-default-directory-list'.
+  case $INFOPATH in
+    *$GUIX_PROFILE/share/info*) ;;
+    *) export INFOPATH=\"$GUIX_PROFILE/share/info:$INFOPATH\" ;;
+  esac
+  # When MANPATH is unset, add a trailing colon so the system default search
+  # path is used.
+  case $MANPATH in
+    *$GUIX_PROFILE/share/man*) ;;
+    *) export MANPATH=\"$GUIX_PROFILE/share/man:$MANPATH\" ;;
+  esac
+  # Expose Guix modules to Guile so guix shell and repls spawned by e.g. Geiser
+  # work out of the box.
+  case $GUILE_LOAD_PATH in
+    *$GUIX_PROFILE/share/guile/site/3.0*) ;;
+    *) export GUILE_LOAD_PATH=\"$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH\" ;;
+  esac
+  case $GUILE_LOAD_COMPILED_PATH in
+    *$GUIX_PROFILE/lib/guile/3.0/site-ccache*) ;;
+    *) export GUILE_LOAD_COMPILED_PATH=\"$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH\" ;;
+  esac
+  # Make sure libXcursor finds cursors installed into user or system profiles.
+  # See <http://bugs.gnu.org/24445>
+  case $XCURSOR_PATH in
+    *$GUIX_PROFILE/share/icons*) ;;
+    *) export XCURSOR_PATH=\"$GUIX_PROFILE/share/icons${XCURSOR_PATH:+:}$XCURSOR_PATH\" ;;
+  esac
+  # Allow Hunspell-based applications (IceCat, LibreOffice, etc.) to find
+  # dictionaries.
+  case $DICPATH in
+    *$GUIX_PROFILE/share/hunspell*) ;;
+    *) export DICPATH=\"$GUIX_PROFILE/share/hunspell${DICPATH:+:}$DICPATH\" ;;
+  esac
+  # Allow GStreamer-based applications to find plugins.
+  case $GST_PLUGIN_PATH in
+    *$GUIX_PROFILE/lib/gstreamer-1.0*) ;;
+    *) export GST_PLUGIN_PATH=\"$GUIX_PROFILE/lib/gstreamer-1.0${GST_PLUGIN_PATH:+:}$GST_PLUGIN_PATH\" ;;
+  esac
 done
 
-# Prepend privileged programs.
+# Prepend paths not in a profile.
 export PATH=/run/privileged/bin:$PATH
-
-# Arrange so that ~/.config/guix/current/share/info comes first.
-export INFOPATH=\"$HOME/.config/guix/current/share/info:$INFOPATH\"
-
-# Set the umask, notably for users logging in via 'lsh'.
-# See <http://bugs.gnu.org/22650>.
-umask 022
-
-# Allow Hunspell-based applications (IceCat, LibreOffice, etc.) to
-# find dictionaries.
-export DICPATH=\"$HOME/.guix-profile/share/hunspell:/run/current-system/profile/share/hunspell\"
-
-# Allow GStreamer-based applications to find plugins.
-export GST_PLUGIN_PATH=\"$HOME/.guix-profile/lib/gstreamer-1.0\"
+export XCURSOR_PATH=\"$HOME/.icons:$XCURSOR_PATH\"
 
 if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
 then
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index b68a818871..cdb804da18 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -179,16 +179,6 @@ (define %default-bash-profile
 
 # Honor per-interactive-shell startup file
 if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
-
-# Merge search-paths from multiple profiles, the order matters.
-eval \"$(guix package --search-paths \\
--p $HOME/.config/guix/current \\
--p $HOME/.guix-home/profile \\
--p $HOME/.guix-profile \\
--p /run/current-system/profile)\"
-
-# Prepend setuid programs.
-export PATH=/run/setuid-programs:$PATH
 "))
 
 (define %default-zprofile
-- 
2.49.0





Information forwarded to hako@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:03:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 11:03:55 2025
Received: from localhost ([127.0.0.1]:50016 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzd9f-0004Aa-DS
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:03:55 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:58942)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzd9X-00049j-Um
 for 77035 <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:03:48 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743519826;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=gZ/VPZyNTh65luBlyPNsnY5BjaCh+Pz0862e/RBsRhk=;
 b=KzZ+VOZqDvuc9rcnquLDfNq/Dr/wzQC0CXPq+h9iEK2E0xfmuxuvBytr5SdU/izfr6/Gef
 eHdUNPxdhqlV5onddiCYvAQ5GnTvKupXV/4OaLqvnBWULoqM7iOzePmTArl6kk8OtQd88t
 4eg6M/1kDakA9IE5+Q0qKfE6Lu/LaGksUIFfC9mvNOoD6f7qfACqPAjmORXayVAbd0FKj4
 +vOl0cB8Kp8y4B3AIRYeh1rABijVIuw38CgirFVrr4hWV1w9+tLa8OSaioqVDJoJCE7jgY
 oPiRuafNZgBMs5fKF6h5NGRuC836W0Z7w7PKbx8ahd7daoFD5LyyJSBNtw8liw==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v3 1/5] system: /etc/profile: Set up all default profiles in
 one iteration.
Date: Tue,  1 Apr 2025 23:02:44 +0800
Message-ID: <8e99166202077cc58e29db4ece30dbd5bb8d7d8b.1743519525.git.hako@HIDDEN>
In-Reply-To: <cover.1743519525.git.hako@HIDDEN>
References: <cover.1743519525.git.hako@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/system.scm (operating-system-etc-service)[profile]: Make Guix Home paths
appear before the default user profile.
Set up Guix System profile in the iteration too.
Rename iteration variable to GUIX_PROFILE.

Change-Id: I18eac738a5dfade84da2effdd6211119c6fdd96f
---
 gnu/system.scm | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 0d98e5a036..c166222854 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1074,10 +1074,6 @@ (define* (operating-system-etc-service os)
 # Ignore the default value of 'PATH'.
 unset PATH
 
-# Load the system profile's settings.
-GUIX_PROFILE=/run/current-system/profile ; \\
-. /run/current-system/profile/etc/profile
-
 # Since 'lshd' does not use pam_env, /etc/environment must be explicitly
 # loaded when someone logs in via SSH.  See <http://bugs.gnu.org/22175>.
 # We need 'PATH' to be defined here, for 'cat' and 'cut'.  Do this before
@@ -1086,24 +1082,22 @@ (define* (operating-system-etc-service os)
      -a -z \"$LINUX_MODULE_DIRECTORY\" ]
 then
   . /etc/environment
-  export `cat /etc/environment | cut -d= -f1`
+  export `/run/current-system/profile/bin/cut -d= -f1 < /etc/environment`
 fi
 
-# Arrange so that ~/.config/guix/current comes first,
-# and guix-home comes before guix-profile.
-for profile in \"$HOME/.guix-profile\"        \\
-               \"$HOME/.guix-home/profile\"   \\
-               \"$HOME/.config/guix/current\"
+# Set up environment for all default profiles.
+for GUIX_PROFILE in \"/run/current-system/profile\" \\
+                    \"$HOME/.guix-home/profile\"   \\
+                    \"$HOME/.guix-profile\"        \\
+                    \"$HOME/.config/guix/current\"
 do
-  if [ -f \"$profile/etc/profile\" ]
+  if [ -f \"$GUIX_PROFILE/etc/profile\" ]
   then
-    # Load the user profile's settings.
-    GUIX_PROFILE=\"$profile\" ; \\
-    . \"$profile/etc/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=\"$profile/bin:$PATH\"
+    export PATH=\"$GUIX_PROFILE/bin:$PATH\"
   fi
 done
 
-- 
2.49.0





Information forwarded to hako@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:03:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 11:03:50 2025
Received: from localhost ([127.0.0.1]:50011 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzd9Z-00049s-P3
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:03:50 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:58938)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzd9V-000499-VK
 for 77035 <at> debbugs.gnu.org; Tue, 01 Apr 2025 11:03:46 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743519822;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=xFyCrjlGmu7ZqtfsPqmXRv9zOybkShfI6O8MCgXlDMk=;
 b=gb8pFESIivV4s+KPDBXhlhAyKf0i3G6Yolu2eEzgMjZXDI7wScd+2ESYRcr3BTy/4ZF4q3
 bgcHOUSPXhwEogsiyGNC56XHRKiP8zn5gt0ok/pqUStnM79JR3E1APbaftxcb0AC8YbR7Z
 lqpGu/0vA8e7DMReItCs8cMGVUBLDbA4MAoMWin4P05ap/dRhrgNOKPVXOsfC4AQPpccJb
 fKHajlGbBQJ9vOZ2SIe2mB7ol2sJyzoIz1B2I87VZ2FOriEFP/QsCIELS5yzKmeyM59OQp
 fnPmFmB/iH1h7OGyPJipJ8Pzqc1mWXGRH4mCt2ByueRSHaCDzKKgeUDSszA8Gw==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v3 0/5] system: Rearrange /etc/profile.
Date: Tue,  1 Apr 2025 23:02:43 +0800
Message-ID: <cover.1743519525.git.hako@HIDDEN>
X-Debbugs-Cc: Andrew Tropin <andrew@HIDDEN>, Janneke Nieuwenhuizen <janneke@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Tanguy Le Carrour <tanguy@HIDDEN>
MIME-Version: 1.0
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

V2 -> V3:
* Rearrange changes.
* Avoid invoking ‘guix’ from profile.

Hilton Chain (5):
  system: /etc/profile: Set up all default profiles in one iteration.
  system: Rearrange /etc/profile.
  system: /etc/profile: Set up extra environment variables for Guix
    Home.
  system & home: profile: Address issues reported by ‘shellcheck’.
  guix-install.sh: Set up all default profiles in one iteration.

 etc/guix-install.sh          |  71 ++++++++++----------
 gnu/home/services.scm        |  22 +++++--
 gnu/home/services/shells.scm |  10 ++-
 gnu/system.scm               | 123 ++++++++++++++++++++++-------------
 gnu/system/shadow.scm        |  10 ---
 5 files changed, 137 insertions(+), 99 deletions(-)


base-commit: 295f6417025638dfcd94b5c19bfbff3c5a85e5e4
--
2.49.0




Information forwarded to hako@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 12:26:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 08:26:18 2025
Received: from localhost ([127.0.0.1]:46925 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzah6-0002WG-1N
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 08:26:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40324)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1tzah1-0002Ue-QL
 for 77035 <at> debbugs.gnu.org; Tue, 01 Apr 2025 08:26:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1tzagv-0001zN-V7; Tue, 01 Apr 2025 08:26:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=igdRdw63SctM8+8+4TBXsEBUMZCKZkuTGmREVphGmFo=; b=bob7JJJukff04QBy025A
 t3QYSf/Wcfc5ArxwhhAWaEyvTd+fgkcrPrclHdzsEKKC+GjfZVXp7rKZuXAOOcXs04usC4JVu6roU
 72j7l2IK3vYree2EaecWWIkm9aTnDgU+1X58skUyuzEoEosxXX2XUEDO27A0pqTlYwQX8wXaN8hYK
 5VaW1BKGdNJgFvHDf1N9i1ZrLEWBUfpu5P8emKslF3r44IkGbTagGJAhCH/WIU4VyND+ZW7ItS7Fz
 WE54MRCALGlJT4qVF9JKEjRNGSi1L6VfyO/XsnFnoHfV+qZ4HW9su7cM3ACY99GblLUvWo4ceNnBX
 n+QfthjnYNv5kA==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Hilton Chain <hako@HIDDEN>
Subject: Re: [bug#77035] [PATCH v2 1/3] system: /etc/profile: Take care of
 all default profiles.
In-Reply-To: <cdf9ba85b52d0a657d16efa9287c6b91760bf4eb.1743438266.git.hako@HIDDEN>
 (Hilton Chain's message of "Tue, 1 Apr 2025 00:25:56 +0800")
References: <cover.1743438266.git.hako@HIDDEN>
 <cdf9ba85b52d0a657d16efa9287c6b91760bf4eb.1743438266.git.hako@HIDDEN>
Date: Tue, 01 Apr 2025 14:25:59 +0200
Message-ID: <87wmc4cbl4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77035
Cc: 77035 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Hilton Chain <hako@HIDDEN> skribis:

> * gnu/system.scm (operating-system-etc-service)[/etc/profile]: Merge sear=
ch
> paths.
> Take care of all default profiles.
> Address some issues reported by =E2=80=98shellcheck=E2=80=99.
> * gnu/system/shadow.scm (%default-bash-profile): Remove duplicated export=
s.
>
> Change-Id: I0e14d7c0266742e0abf07779e501de0e257c1329

I=E2=80=99m afraid there are too many changes, mostly unrelated here, and m=
ostly
not covered by the commit log.  :-)

Could you split it somewhat and explain?

> +# Merge search paths and set up environment for all default profiles.
> +eval \"$(/run/current-system/profile/bin/guix package \\
> +  --search-paths=3Dprefix \\
> +  --profile=3D\"$HOME/.config/guix/current\" \\
> +  --profile=3D\"$HOME/.guix-profile\" \\
> +  --profile=3D\"$HOME/.guix-home/profile\" \\
> +  --profile=3D/run/current-system/profile)\"

FWIW, this (invoking =E2=80=98guix package=E2=80=99 from /etc/profile) was =
explicitly
rejected back then:

  https://issues.guix.gnu.org/20255#32

So at least let=E2=80=99s not address it in the middle of other changes.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 31 Mar 2025 16:26:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 31 12:26:59 2025
Received: from localhost ([127.0.0.1]:42594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzHyU-0005uS-RK
	for submit <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:26:59 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:43448)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzHyQ-0005tr-UP
 for 77035 <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:26:55 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743438413;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=fbZvvBXbHWjJEHnEZj38fBMgpGPNTGYJv8k22tAAn3g=;
 b=jF56LrTft5hGfJvRU+QhYhZDCMytQYN+h74jLqdQksuT508wKWiwpL3lRuV5cGl/ovHQTG
 Mk5x/z9umNm7Aw5Wwn3whyQbpyVl9szZlEuo1XJ6FelQXvGxK9ffU9GG6E14TkC0ONhdAu
 P45E9JW2indBgZGK21YcsrpJ3Jk0M6tYPZnBrLqE1JwSfyg3apSZ3kPeXMvt+VvSXo+T//
 GEgcag4OmNoi0d1IjF8XLyWfhHfkUVmWQms2Vgj5D5FfR/jdt5ogLbglO9K5U8ZqnRpAC4
 NvsC+LkZKa74mPXYba6/ot3DBXE7ob3kNaumrcccs2ZmdFwxrg+zlqmLIuBr2A==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v2 3/3] guix-install.sh: /etc/profile.d/zzz-guix.sh: Handle
 Guix Home profile.
Date: Tue,  1 Apr 2025 00:25:58 +0800
Message-ID: <043b31de365ae667a9d7d5588f228b94eb27e267.1743438266.git.hako@HIDDEN>
In-Reply-To: <cover.1743438266.git.hako@HIDDEN>
References: <cover.1743438266.git.hako@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* etc/guix-install.sh (sys_create_init_profile): Handle Guix Home profile.
Arrange so that imperative profiles order first.

Change-Id: I60057c071d1d29f7930e027720f6f86a0c6b4254
---
 etc/guix-install.sh | 86 +++++++++++++++++++++++++++------------------
 1 file changed, 52 insertions(+), 34 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index b5d833cd64..2010dab4d0 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -749,47 +749,65 @@ export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}"
 export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
 # no default for XDG_RUNTIME_DIR (depends on foreign distro for semantics)
 
-# `guix pull` profile
-GUIX_PROFILE="$HOME/.config/guix/current"
-export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH"
-# Add to INFOPATH and MANPATH so the latest Guix documentation is available to
-# info and man readers.  When INFOPATH is unset, add a trailing colon so Emacs
-# searches 'Info-default-directory-list'.  When MANPATH is unset, add a
-# trailing colon so the system default search path is used.
-export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH"
-export MANPATH="$GUIX_PROFILE/share/man:$MANPATH"
-# Expose the latest Guix modules to Guile so guix shell and repls spawned by
-# e.g. Geiser work out of the box.
-export GUILE_LOAD_PATH="$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
-export GUILE_LOAD_COMPILED_PATH="$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
+# Merge search paths and set up environment for all default profiles.
+eval "$(guix package \
+  --search-paths=prefix \
+  --profile="$HOME/.config/guix/current" \
+  --profile="$HOME/.guix-profile" \
+  --profile="$HOME/.guix-home/profile")"
+
+for profile in "$HOME/.guix-home/profile" \
+               "$HOME/.guix-profile" \
+               "$HOME/.config/guix/current"
+do
+  GUIX_PROFILE="$profile"
+  if [ -L "$GUIX_PROFILE" ]; then
+    # Documentation search paths may be handled by $GUIX_PROFILE/etc/profile if
+    # the user installs info and man readers via Guix.  If the user doesn’t,
+    # explicitly add to them so documentation for software from ‘guix install’
+    # is available to the system info and man readers.  When INFOPATH is unset,
+    # add a trailing colon so Emacs searches 'Info-default-directory-list'.
+    # When MANPATH is unset, add a trailing colon so the system default search
+    # path is used.
+    case $INFOPATH in
+      *$GUIX_PROFILE/share/info*) ;;
+      *) export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH" ;;
+    esac
+    case $MANPATH in
+      *$GUIX_PROFILE/share/man*) ;;
+      *) export MANPATH="$GUIX_PROFILE/share/man:$MANPATH"
+    esac
+  fi
+done
 
-# User's default profile, if it exists
+# See info '(guix) Application Setup'.
 GUIX_PROFILE="$HOME/.guix-profile"
 if [ -L "$GUIX_PROFILE" ]; then
-  . "$GUIX_PROFILE/etc/profile"
-
-  # see info '(guix) Application Setup'
   export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH"
-
-  # Documentation search paths may be handled by $GUIX_PROFILE/etc/profile if
-  # the user installs info and man readers via Guix.  If the user doesn’t,
-  # explicitly add to them so documentation for software from ‘guix install’
-  # is available to the system info and man readers.
-  case $INFOPATH in
-    *$GUIX_PROFILE/share/info*) ;;
-    *) export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH" ;;
-  esac
-  case $MANPATH in
-    *$GUIX_PROFILE/share/man*) ;;
-    *) export MANPATH="$GUIX_PROFILE/share/man:$MANPATH"
-  esac
 fi
 
-# NOTE: Guix Home handles its own profile initialization in ~/.profile. See
-# info '(guix) Configuring the Shell'.
-
-# Clean up after ourselves.
+# Make ‘guix pull’ profile work out of the box.
+GUIX_PROFILE="$HOME/.config/guix/current"
+case $PATH in
+  *$GUIX_PROFILE/bin*) ;;
+  *) export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH" ;;
+esac
+# Expose the latest Guix modules to Guile so guix shell and repls spawned by
+# e.g. Geiser work out of the box.
+case $GUILE_LOAD_PATH in
+  *$GUIX_PROFILE/share/guile/site/3.0*) ;;
+  *) export GUILE_LOAD_PATH="$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" ;;
+esac
+case $GUILE_LOAD_COMPILED_PATH in
+  *$GUIX_PROFILE/lib/guile/3.0/site-ccache*) ;;
+  *) export GUILE_LOAD_COMPILED_PATH="$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" ;;
+esac
 unset GUIX_PROFILE
+
+# Set up extra environment variables for Guix Home.
+HOME_ENVIRONMENT="$HOME/.guix-home"
+[ -L "$HOME_ENVIRONMENT" ] && . "$HOME_ENVIRONMENT/setup-environment"
+unset HOME_ENVIRONMENT
 EOF
 }
 
-- 
2.49.0





Information forwarded to hako@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 31 Mar 2025 16:26:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 31 12:26:58 2025
Received: from localhost ([127.0.0.1]:42592 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzHyU-0005uH-36
	for submit <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:26:58 -0400
Received: from mx.boiledscript.com ([2a01:4f8:10b:392::42]:55954)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzHyM-0005t9-Eo
 for 77035 <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:26:51 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743438409;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=uaRJtr4Oimk15LlT3xQw2nloVJ56z2EOx+qIeINJmeA=;
 b=N/J+jkq1NGrSwXzTVfXRuV/7vY8/rVnaV6tf3mpXG+mDik9MMeYoqc19syVjUFYMH3FisG
 ZCsjkCHMmVwnnvzCe5IxLFq+KaiFkPHxYVswf4CAx+4AzF+pwVXMEnG0JRDQ0ZH2755ky7
 1xJOi3ytut7w0gVD1ahOzLqx2D4uPeunqv81opM6O7Rclg/tohqTfUVi2EyHJ2v0hpVwVr
 7FbNO4s1wX+XWkNWXqtE+Vs2ohThH/F1/jS0SXAHXcaNPqE2eimvsI9+S042WF6Jx2OSp0
 /5VJliCsVUP8gUSqFecrk+vvRwZOx7txusVLQsuzcaY0e3rK2WS1yQw+E+lw4A==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v2 2/3] home: setup-environment: Skip if already initialized.
Date: Tue,  1 Apr 2025 00:25:57 +0800
Message-ID: <70536e22ec65aeb8f27f140417c43b075e774a92.1743438266.git.hako@HIDDEN>
In-Reply-To: <cover.1743438266.git.hako@HIDDEN>
References: <cover.1743438266.git.hako@HIDDEN>
MIME-Version: 1.0
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Andrew Tropin <andrew@HIDDEN>, Janneke Nieuwenhuizen <janneke@HIDDEN>, Tanguy Le Carrour <tanguy@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/home/services.scm (environment-variables->setup-environment-script):
Skip initializing home profile if already finished.
Address some issues reported by ‘shellcheck’.
* gnu/home/services/shells.scm (add-shell-profile-file): Skip
setup-environment if already finished.
Address some issues reported by ‘shellcheck’.

Change-Id: Ife4100c6b19f61272525eebc82931c81784fe9e0
---
 gnu/home/services.scm        | 18 +++++++++++-------
 gnu/home/services/shells.scm | 10 +++++++---
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 85a43f80ca..39ad31515c 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -279,31 +279,35 @@ (define (environment-variables->setup-environment-script vars)
 # ~/.profile does)
 GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\"
 PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\"
-[ -f $PROFILE_FILE ] && . $PROFILE_FILE
+# Skip if already initialized.
+case $INFOPATH in
+  *$GUIX_PROFILE/share/info*) ;;
+  *) [ -f \"$PROFILE_FILE\" ] && . \"$PROFILE_FILE\" ;;
+esac
 
 case $GUIX_LOCPATH in
   *$GUIX_PROFILE/lib/locale*) ;;
-  *) export GUIX_LOCPATH=$GUIX_PROFILE/lib/locale:$GUIX_LOCPATH ;;
+  *) export GUIX_LOCPATH=\"$GUIX_PROFILE/lib/locale:$GUIX_LOCPATH\" ;;
 esac
 case $XDG_DATA_DIRS in
   *$GUIX_PROFILE/share*) ;;
-  *) export XDG_DATA_DIRS=$GUIX_PROFILE/share:$XDG_DATA_DIRS ;;
+  *) export XDG_DATA_DIRS=\"$GUIX_PROFILE/share:$XDG_DATA_DIRS\" ;;
 esac
 case $MANPATH in
   *$GUIX_PROFILE/share/man*) ;;
-  *) export MANPATH=$GUIX_PROFILE/share/man:$MANPATH
+  *) export MANPATH=\"$GUIX_PROFILE/share/man:$MANPATH\" ;;
 esac
 case $INFOPATH in
   *$GUIX_PROFILE/share/info*) ;;
-  *) export INFOPATH=$GUIX_PROFILE/share/info:$INFOPATH ;;
+  *) export INFOPATH=\"$GUIX_PROFILE/share/info:$INFOPATH\" ;;
 esac
 case $XDG_CONFIG_DIRS in
   *$GUIX_PROFILE/etc/xdg*) ;;
-  *) export XDG_CONFIG_DIRS=$GUIX_PROFILE/etc/xdg:$XDG_CONFIG_DIRS ;;
+  *) export XDG_CONFIG_DIRS=\"$GUIX_PROFILE/etc/xdg:$XDG_CONFIG_DIRS\" ;;
 esac
 case $XCURSOR_PATH in
   *$GUIX_PROFILE/share/icons*) ;;
-  *) export XCURSOR_PATH=$GUIX_PROFILE/share/icons:$XCURSOR_PATH ;;
+  *) export XCURSOR_PATH=\"$GUIX_PROFILE/share/icons:$XCURSOR_PATH\" ;;
 esac
 
 # Keep the shell environment clean.
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index bab5730c3d..ce61eaa4b0 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -87,9 +87,13 @@ (define (add-shell-profile-file config)
      ,(mixed-text-file
        "shell-profile"
        "\
-HOME_ENVIRONMENT=$HOME/.guix-home
-. $HOME_ENVIRONMENT/setup-environment
-$HOME_ENVIRONMENT/on-first-login
+HOME_ENVIRONMENT=\"$HOME/.guix-home\"
+# Skip if already sourced.
+case $GUIX_LOCPATH in
+  *$HOME_ENVIRONMENT/profile/lib/locale*) ;;
+  *) . \"$HOME_ENVIRONMENT/setup-environment\" ;;
+esac
+\"$HOME_ENVIRONMENT/on-first-login\"
 unset HOME_ENVIRONMENT\n"
        (serialize-configuration
         config
-- 
2.49.0





Information forwarded to hako@HIDDEN, ludo@HIDDEN, andrew@HIDDEN, janneke@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 31 Mar 2025 16:26:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 31 12:26:58 2025
Received: from localhost ([127.0.0.1]:42590 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzHyT-0005uE-Cp
	for submit <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:26:58 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:43272)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzHyG-0005sC-KA
 for 77035 <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:26:46 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743438402;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=YVrTHTt0bqEnc1myNa4SyNS1/6XW0Rs08CYO5WINEKA=;
 b=KoT5+ybHxOcDevicXU9pcqrUWsJA7/rNogqIqAOQD/GDH8cYAttwktivKXhSwlYZ4OvHdb
 pJn6c/FSkww1ZKAw5WHM96ktehozQgyL9dZg6X4PJumnGwjYbPY4O9b2v6j/QPRqRcxul7
 Y5pObNuxpNNfrhfB6HP39xPn8Pi5C1BQPRVP+zRsKZrs9mJvbALMD66NZvSePbKK0pSUC5
 NmYEyM1kM3ilFOQn3qs+J5Paq0kftlC05VhoTKgNRjoy5JrKLyHzeIC/yBK3RAa1FQSFKY
 Mvl4eJZqtG/rOxt70hjmov4YBHwhtXrgq7FMUMQLiprH7zDWvQeaiZV6APJeNA==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v2 1/3] system: /etc/profile: Take care of all default
 profiles.
Date: Tue,  1 Apr 2025 00:25:56 +0800
Message-ID: <cdf9ba85b52d0a657d16efa9287c6b91760bf4eb.1743438266.git.hako@HIDDEN>
In-Reply-To: <cover.1743438266.git.hako@HIDDEN>
References: <cover.1743438266.git.hako@HIDDEN>
MIME-Version: 1.0
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/system.scm (operating-system-etc-service)[/etc/profile]: Merge search
paths.
Take care of all default profiles.
Address some issues reported by ‘shellcheck’.
* gnu/system/shadow.scm (%default-bash-profile): Remove duplicated exports.

Change-Id: I0e14d7c0266742e0abf07779e501de0e257c1329
---
 gnu/system.scm        | 155 ++++++++++++++++++++++++++++--------------
 gnu/system/shadow.scm |  10 ---
 2 files changed, 104 insertions(+), 61 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 0d98e5a036..e05f5938bc 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1060,71 +1060,124 @@ (define* (operating-system-etc-service os)
         ;; Startup file for POSIX-compliant login shells, which set system-wide
         ;; environment variables.
         (profile    (mixed-text-file "profile"  "\
-# Crucial variables that could be missing in the profiles' 'etc/profile'
-# because they would require combining both profiles.
-# FIXME: See <http://bugs.gnu.org/20255>.
-export MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man
-export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info
-export XDG_DATA_DIRS=$HOME/.guix-profile/share:/run/current-system/profile/share
-export XDG_CONFIG_DIRS=$HOME/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg
-
-# Make sure libXcursor finds cursors installed into user or system profiles.  See <http://bugs.gnu.org/24445>
-export XCURSOR_PATH=$HOME/.icons:$HOME/.guix-profile/share/icons:/run/current-system/profile/share/icons
+# Set the umask, notably for users logging in via 'lsh'.
+# See <http://bugs.gnu.org/22650>.
+umask 022
 
 # Ignore the default value of 'PATH'.
 unset PATH
 
-# Load the system profile's settings.
-GUIX_PROFILE=/run/current-system/profile ; \\
-. /run/current-system/profile/etc/profile
-
 # Since 'lshd' does not use pam_env, /etc/environment must be explicitly
 # loaded when someone logs in via SSH.  See <http://bugs.gnu.org/22175>.
-# We need 'PATH' to be defined here, for 'cat' and 'cut'.  Do this before
-# reading the user's 'etc/profile' to allow variables to be overridden.
-if [ -f /etc/environment -a -n \"$SSH_CLIENT\" \\
-     -a -z \"$LINUX_MODULE_DIRECTORY\" ]
+# Do this before reading the user's 'etc/profile' to allow variables to be
+# overridden.
+if [ -f /etc/environment ] && [ -n \"$SSH_CLIENT\" ] &&
+     [ -z \"$LINUX_MODULE_DIRECTORY\" ]
 then
   . /etc/environment
-  export `cat /etc/environment | cut -d= -f1`
+  export \"$(/run/current-system/profile/bin/cut -d= -f1 < /etc/environment)\"
 fi
 
-# Arrange so that ~/.config/guix/current comes first,
-# and guix-home comes before guix-profile.
-for profile in \"$HOME/.guix-profile\"        \\
-               \"$HOME/.guix-home/profile\"   \\
-               \"$HOME/.config/guix/current\"
-do
-  if [ -f \"$profile/etc/profile\" ]
-  then
-    # Load the user profile's settings.
-    GUIX_PROFILE=\"$profile\" ; \\
-    . \"$profile/etc/profile\"
-  else
-    # At least define this one so that basic things just work
-    # when the user installs their first package.
-    export PATH=\"$profile/bin:$PATH\"
-  fi
-done
+# Merge search paths and set up environment for all default profiles.
+eval \"$(/run/current-system/profile/bin/guix package \\
+  --search-paths=prefix \\
+  --profile=\"$HOME/.config/guix/current\" \\
+  --profile=\"$HOME/.guix-profile\" \\
+  --profile=\"$HOME/.guix-home/profile\" \\
+  --profile=/run/current-system/profile)\"
+
+# Make ‘guix pull’ profile work out of the box.
+GUIX_PROFILE=\"$HOME/.config/guix/current\"
+case $PATH in
+  *$GUIX_PROFILE/bin*) ;;
+  *) export PATH=\"$GUIX_PROFILE/bin${PATH:+:}$PATH\" ;;
+esac
+# Expose the latest Guix modules to Guile so guix shell and repls spawned by
+# e.g. Geiser work out of the box.
+case $GUILE_LOAD_PATH in
+  *$GUIX_PROFILE/share/guile/site/3.0*) ;;
+  *) export GUILE_LOAD_PATH=\"$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH\" ;;
+esac
+case $GUILE_LOAD_COMPILED_PATH in
+  *$GUIX_PROFILE/lib/guile/3.0/site-ccache*) ;;
+  *) export GUILE_LOAD_COMPILED_PATH=\"$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH\" ;;
+esac
+unset GUIX_PROFILE
 
 # Prepend privileged programs.
-export PATH=/run/privileged/bin:$PATH
-
-# Arrange so that ~/.config/guix/current/share/info comes first.
-export INFOPATH=\"$HOME/.config/guix/current/share/info:$INFOPATH\"
-
-# Set the umask, notably for users logging in via 'lsh'.
-# See <http://bugs.gnu.org/22650>.
-umask 022
-
-# Allow Hunspell-based applications (IceCat, LibreOffice, etc.) to
-# find dictionaries.
-export DICPATH=\"$HOME/.guix-profile/share/hunspell:/run/current-system/profile/share/hunspell\"
-
+export PATH=\"/run/privileged/bin:$PATH\"
+
+# Crucial variables that could be missing in the profiles' 'etc/profile'.
+if [ -z \"$XDG_DATA_DIRS\" ]; then
+  export XDG_DATA_DIRS=\"`
+         `$HOME/.guix-profile/share:`
+         `$HOME/.guix-home/profile/share:`
+         `/run/current-system/profile/share\"
+fi
+if [ -z \"$XDG_CONFIG_DIRS\" ]; then
+  export XDG_CONFIG_DIRS=\"`
+         `$HOME/.guix-profile/etc/xdg:`
+         `$HOME/.guix-home/profile/etc/xdg:`
+         `/run/current-system/profile/etc/xdg\"
+fi
+# When MANPATH is unset, add a trailing colon so the system default search path
+# is used.
+if [ -z \"$MANPATH\" ]; then
+  export MANPATH=\"`
+         `$HOME/.guix-profile/share/man:`
+         `$HOME/.guix-home/profile/share/man:`
+         `/run/current-system/profile/share/man:\"
+fi
+# When INFOPATH is unset, add a trailing colon so Emacs searches
+# 'Info-default-directory-list'.
+if [ -z \"$INFOPATH\" ]; then
+  export INFOPATH=\"`
+         `$HOME/.config/guix/current/share/info:`
+         `$HOME/.guix-profile/share/info:`
+         `$HOME/.guix-home/profile/share/info:`
+         `/run/current-system/profile/share/info:\"
+else
+  case $INFOPATH in
+    *$HOME/.config/guix/current/share/info*) ;;
+    *) export INFOPATH=\"$HOME/.config/guix/current/share/info:$INFOPATH\" ;;
+  esac
+fi
+# Make sure libXcursor finds cursors installed into user or system profiles.
+# See <http://bugs.gnu.org/24445>
+if [ -z \"$XCURSOR_PATH\" ]; then
+  export XCURSOR_PATH=\"`
+         `$HOME/.icons:`
+         `$HOME/.guix-profile/share/icons:`
+         `$HOME/.guix-home/profile/share/icons:`
+         `/run/current-system/profile/share/icons\"
+else
+  case $XCURSOR_PATH in
+    *$HOME/.icons*) ;;
+    *) export XCURSOR_PATH=\"$HOME/.icons:$XCURSOR_PATH\" ;;
+  esac
+fi
+# Allow Hunspell-based applications (IceCat, LibreOffice, etc.) to find
+# dictionaries.
+if [ -z \"$DICPATH\" ]; then
+  export DICPATH=\"`
+         `$HOME/.guix-profile/share/hunspell:`
+         `$HOME/.guix-home/profile/share/hunspell:`
+         `/run/current-system/profile/share/hunspell\"
+fi
 # Allow GStreamer-based applications to find plugins.
-export GST_PLUGIN_PATH=\"$HOME/.guix-profile/lib/gstreamer-1.0\"
+if [ -z \"$GST_PLUGIN_PATH\" ]; then
+  export GST_PLUGIN_PATH=\"`
+         `$HOME/.guix-profile/lib/gstreamer-1.0:`
+         `$HOME/.guix-home/profile/lib/gstreamer-1.0:`
+         `/run/current-system/profile/lib/gstreamer-1.0\"
+fi
+
+# Set up extra environment variables for Guix Home.
+HOME_ENVIRONMENT=\"$HOME/.guix-home\"
+[ -L \"$HOME_ENVIRONMENT\" ] && . \"$HOME_ENVIRONMENT/setup-environment\"
+unset HOME_ENVIRONMENT
 
-if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
+if [ -n \"$BASH_VERSION\" ] && [ -f /etc/bashrc ]
 then
   # Load Bash-specific initialization code.
   . /etc/bashrc
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index b68a818871..cdb804da18 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -179,16 +179,6 @@ (define %default-bash-profile
 
 # Honor per-interactive-shell startup file
 if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
-
-# Merge search-paths from multiple profiles, the order matters.
-eval \"$(guix package --search-paths \\
--p $HOME/.config/guix/current \\
--p $HOME/.guix-home/profile \\
--p $HOME/.guix-profile \\
--p /run/current-system/profile)\"
-
-# Prepend setuid programs.
-export PATH=/run/setuid-programs:$PATH
 "))
 
 (define %default-zprofile
-- 
2.49.0





Information forwarded to hako@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 31 Mar 2025 16:26:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 31 12:26:43 2025
Received: from localhost ([127.0.0.1]:42585 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzHyF-0005sB-08
	for submit <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:26:43 -0400
Received: from mx.boiledscript.com ([2a01:4f8:10b:392::42]:59266)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1tzHyC-0005rk-OS
 for 77035 <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:26:41 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743438398;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=cKozGfK3QRr5QCnPXFJsPhB240h7lDJMLnados9c6ik=;
 b=b+E53MApQCjQm01TSaFIlvwNUTJAfNqf/X/4B1O0QdboCQLVCYarDwLG7o7LxhSwh++lE/
 IU4GjHM3KQ6cFDAj3TLhvonATV6i1tJbBY3KUB1PwHfra+9x4HGOI5Y4AePgjWxADMpSPO
 s32KS30Zoh27+mlKUSX4FZs2eiV9c6eIcyfaGgaPYpFCT+ZAI4McMhe1D2SKr8vTSQJlNE
 4EImhk4J0xdQgBUO+59zuVguX9FaF+X52KCLkyqLGRM6I8QeP0t4MD/TsfFWyFxZzPPHRl
 ulyVa3aJUaucS3G3s0MYfc36I0ZDZhfbtqDvtdOssRPRYUVHvPdlgdOMe5oGlA==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH v2 0/3] system: /etc/profile: Take care of all default
 profiles.
Date: Tue,  1 Apr 2025 00:25:55 +0800
Message-ID: <cover.1743438266.git.hako@HIDDEN>
MIME-Version: 1.0
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Andrew Tropin <andrew@HIDDEN>, Janneke Nieuwenhuizen <janneke@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Tanguy Le Carrour <tanguy@HIDDEN>
X-Debbugs-Cc: Hilton Chain <hako@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

I ended up with a bigger change, so sending v2 for review ;)

Note that I haven't tested the guix-install.sh change yet.

Hilton Chain (3):
  system: /etc/profile: Take care of all default profiles.
  home: setup-environment: Skip if already initialized.
  guix-install.sh: /etc/profile.d/zzz-guix.sh: Handle Guix Home profile.

 etc/guix-install.sh          |  86 +++++++++++--------
 gnu/home/services.scm        |  18 ++--
 gnu/home/services/shells.scm |  10 ++-
 gnu/system.scm               | 155 +++++++++++++++++++++++------------
 gnu/system/shadow.scm        |  10 ---
 5 files changed, 174 insertions(+), 105 deletions(-)


base-commit: 77d5eb4c16984e430b377e0b5f1551fbda171ec6
--
2.49.0




Information forwarded to hako@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 19 Mar 2025 10:30:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 19 06:30:10 2025
Received: from localhost ([127.0.0.1]:48571 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tuqgb-0001qV-7F
	for submit <at> debbugs.gnu.org; Wed, 19 Mar 2025 06:30:10 -0400
Received: from hera.aquilenet.fr ([185.233.100.1]:57664)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1tuqgW-0001oQ-RV
 for 77035 <at> debbugs.gnu.org; Wed, 19 Mar 2025 06:30:06 -0400
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id A79372FF;
 Wed, 19 Mar 2025 11:29:58 +0100 (CET)
Authentication-Results: hera.aquilenet.fr;
	none
X-Virus-Scanned: Debian amavis at hera.aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP
 id ZDtc0ESnqSsy; Wed, 19 Mar 2025 11:29:58 +0100 (CET)
Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id ACEB5D9;
 Wed, 19 Mar 2025 11:29:56 +0100 (CET)
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Hilton Chain <hako@HIDDEN>
Subject: Re: [bug#77035] [PATCH 0/2] home: setup-environment: Avoid
 prepending duplicated PATH.
In-Reply-To: <cover.1742043963.git.hako@HIDDEN> (Hilton Chain's
 message of "Sat, 15 Mar 2025 21:23:22 +0800")
References: <cover.1742043963.git.hako@HIDDEN>
Date: Wed, 19 Mar 2025 11:29:56 +0100
Message-ID: <87v7s5fh3v.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Rspamd-Queue-Id: A79372FF
X-Spamd-Result: default: False [-5.88 / 15.00]; BAYES_HAM(-3.00)[99.99%];
 NEURAL_HAM(-2.78)[-0.928]; MIME_GOOD(-0.10)[text/plain];
 FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+];
 RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_FIVE(0.00)[5];
 ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[];
 FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[];
 MID_RHS_MATCH_FROM(0.00)[]
X-Rspamd-Action: no action
X-Spamd-Bar: -----
X-Rspamd-Server: hera
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 77035
Cc: 77035 <at> debbugs.gnu.org, Janneke Nieuwenhuizen <janneke@HIDDEN>,
 Tanguy Le Carrour <tanguy@HIDDEN>, Andrew Tropin <andrew@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi Hilton,

Hilton Chain <hako@HIDDEN> skribis:

> With this change, it will be changed to:
>
> /run/privileged/bin
> ~/.config/guix/current/bin
> ~/.guix-profile/bin
> ~/.guix-profile/sbin
> ~/.guix-home/profile/bin
> ~/.guix-home/profile/sbin
> /run/current-system/profile/bin
> /run/current-system/profile/sbin
>
>
> I haven't changed guix-install.sh yet, so the following remains on foregin
> distros:
>
> ~/.guix-home/profile/bin
> ~/.guix-home/profile/sbin
> ~/.guix-profile/bin
> ~/.guix-profile/sbin
>
> If you agree with [PATCH 1/2], I'll change guix-install.sh too.

This LGTM.  I let you send the =E2=80=98guix-install.sh=E2=80=99 change and=
 then push it
all at once, sounds good?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 15 Mar 2025 13:25:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 15 09:25:16 2025
Received: from localhost ([127.0.0.1]:39869 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ttRVr-0002Nk-T5
	for submit <at> debbugs.gnu.org; Sat, 15 Mar 2025 09:25:16 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:57098)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1ttRVk-0002Gf-OP
 for 77035 <at> debbugs.gnu.org; Sat, 15 Mar 2025 09:25:11 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1742045107;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=ZqFFpKD5aV3/DtOyLAALRvGafOsNTsr4dymKFRwJQRA=;
 b=UKCBFSEcJzeh+NwNOH/4Z2cVHrnUdrtNH22xlJMEpabwDMlMJ41ERmagzfXnyCRsX3bjDG
 yKnbnxYsc4E0/Gel5LQV6UD6HaM4BBYYfvmpju03yp0DptZ1a7lECyOSMYpNmxxppmNacy
 E91Pd1Uk2uI5xS32NkHSEoDYubKUV0yraG1hHE79vYjk1dE7yYXjujc3rp2hXrppM8X7ae
 jTgJ6jRbWvRg9GD095s9Dt59Glv+3U+KcyccLBCxLcO2EgCNJilntxBAkKzUyTaOZbk77J
 XRaVSQNMw2wfYxrdgQovBuCcO64qtPQz0dpC5GBfkex3eRZB/wO0e2uLXDHxFQ==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH 2/2] home: setup-environment: Avoid prepending duplicated PATH.
Date: Sat, 15 Mar 2025 21:24:46 +0800
Message-ID: <2805fcddfaf4a65cc988e001b7534bd7c23810cd.1742043963.git.hako@HIDDEN>
In-Reply-To: <cover.1742043963.git.hako@HIDDEN>
References: <cover.1742043963.git.hako@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Andrew Tropin <andrew@HIDDEN>, Janneke Nieuwenhuizen <janneke@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Tanguy Le Carrour <tanguy@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This makes best effort to order /run/privileged/bin first.

* gnu/home/services.scm (environment-variables->setup-environment-script):
Avoid prepending duplicated PATH.

Change-Id: I580fbbf4786b56b903c1a4d6eb5fa92a70e331b4
---
 gnu/home/services.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 85a43f80ca..9855e26d97 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -278,9 +278,21 @@ (define (environment-variables->setup-environment-script vars)
 # NOTE: Set HOME_ENVIRONMENT before sourcing (home-shell-profile-service-type ensures
 # ~/.profile does)
 GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\"
+
+# Check if PATH for home profile was already set by /etc/profile.
+case $PATH in
+  *$GUIX_PROFILE/bin*) OLD_PATH=$PATH ;;
+esac
+
 PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\"
 [ -f $PROFILE_FILE ] && . $PROFILE_FILE
 
+# Don't modify PATH if it was already set for home profile.
+# This ensures /run/privileged/bin to be ordered first.
+if [ -n \"$OLD_PATH\" ]; then
+  export PATH=$OLD_PATH
+fi
+
 case $GUIX_LOCPATH in
   *$GUIX_PROFILE/lib/locale*) ;;
   *) export GUIX_LOCPATH=$GUIX_PROFILE/lib/locale:$GUIX_LOCPATH ;;
@@ -307,7 +319,7 @@ (define (environment-variables->setup-environment-script vars)
 esac
 
 # Keep the shell environment clean.
-unset GUIX_PROFILE PROFILE_FILE
+unset OLD_PATH GUIX_PROFILE PROFILE_FILE
 
 " port)
                              (display
-- 
2.48.1





Information forwarded to andrew@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at 77035 <at> debbugs.gnu.org:


Received: (at 77035) by debbugs.gnu.org; 15 Mar 2025 13:25:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 15 09:25:09 2025
Received: from localhost ([127.0.0.1]:39860 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ttRVk-0002Gn-K7
	for submit <at> debbugs.gnu.org; Sat, 15 Mar 2025 09:25:08 -0400
Received: from mx.boiledscript.com ([88.99.243.112]:57086)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1ttRVi-0002EV-EW
 for 77035 <at> debbugs.gnu.org; Sat, 15 Mar 2025 09:25:07 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1742045105;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=z4+CzNPTpog3wxuCriGE45M5oWWQJLTggoSg07q1LmI=;
 b=Y0QxF/fyARmzM2NogsCDkHtjP1oA/753+xCSyV17DCFMsn+sI0FPLZAUSeYRep5J9sFApI
 INm+HcJAK0zlvnixL46rWsPYiUMNLbD2Iu22/OgF1iv0ATj4VO61fnHm2O90vl9jxyeUW5
 Bdgxxekt0V7+sMY5/u6fmPUGq2Mcw8WkGvDITwNxIXxuh4LhcZ2QMM8ozfTmklm0FbOOJL
 20Qvmvfz6fKzqWo/3W7Z3YFGvuGP/KJDe8dOKptrLxtRDWSi9U8Ga1tsLBlk1D0jJY2a8P
 JLy7mzcZk9SRd/C0/252q62EfVzFf7C/NtBDG3NSxXr6BJ05UWoEmS6FLYVXXQ==
To: 77035 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: system: Order imperative profiles first in
 etc/profile.
Date: Sat, 15 Mar 2025 21:24:45 +0800
Message-ID: <bf32b4c6c4ccb463a99faa3e4d0c90c1f5ae35bc.1742043963.git.hako@HIDDEN>
In-Reply-To: <cover.1742043963.git.hako@HIDDEN>
References: <cover.1742043963.git.hako@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77035
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/system.scm (operating-system-etc-service): Swap profile order for
guix-package and guix-home.

Change-Id: Id32568772f4944c22ad830e7416a97d6b0adb66c
---
 gnu/system.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 0d98e5a036..6c4b4efc3a 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1090,9 +1090,9 @@ (define* (operating-system-etc-service os)
 fi
 
 # Arrange so that ~/.config/guix/current comes first,
-# and guix-home comes before guix-profile.
-for profile in \"$HOME/.guix-profile\"        \\
-               \"$HOME/.guix-home/profile\"   \\
+# and guix-profile comes before guix-home.
+for profile in \"$HOME/.guix-home/profile\"   \\
+               \"$HOME/.guix-profile\"        \\
                \"$HOME/.config/guix/current\"
 do
   if [ -f \"$profile/etc/profile\" ]
-- 
2.48.1





Information forwarded to guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Mar 2025 13:23:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 15 09:23:53 2025
Received: from localhost ([127.0.0.1]:39852 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ttRUX-00029m-Bq
	for submit <at> debbugs.gnu.org; Sat, 15 Mar 2025 09:23:53 -0400
Received: from lists.gnu.org ([2001:470:142::17]:38736)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1ttRUQ-00029S-Sa
 for submit <at> debbugs.gnu.org; Sat, 15 Mar 2025 09:23:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hako@HIDDEN>)
 id 1ttRUJ-0007qq-R7
 for guix-patches@HIDDEN; Sat, 15 Mar 2025 09:23:40 -0400
Received: from mx.boiledscript.com ([2a01:4f8:10b:392::42])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hako@HIDDEN>)
 id 1ttRUH-0005Gs-PB
 for guix-patches@HIDDEN; Sat, 15 Mar 2025 09:23:39 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1742045015;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=AXGbx2N8d2tREn1QlcjQrZUeL1qBvATg+M2kXtOLUO8=;
 b=M/UXrwYFgunwZdnzhwLhbLlHo+hej9GAqHJAOtLlg0r6oE5lUQv+7gBi0fMJW3e5b0EbTq
 pUU+lygoDjWNVoNEOkW/I9SwHQ4dQriJnl1WF2uZ7pnSq1ak0goQ4YAMoGPeVHsp9C7MTG
 ixcyDv2Ycbi7lkyYvi8QGlk2d4RoscxBQ8dPOwGLX5trsfZXtk6A8WhObGsY8yMtTwfQ7l
 qyj/Ry4RDFzXhM1I8dVcDBWRoFVRklLJqD21cH0Dee60wgj3/hG6umsh5PyM7tK89Q7X6F
 D8D/3blZIkyghPg0bMjeLmJ2OpXuEFaUroyPBZcaKRf2fWl0w1iMh0CBm3qMvA==
To: guix-patches@HIDDEN
Subject: [PATCH 0/2] home: setup-environment: Avoid prepending duplicated PATH.
Date: Sat, 15 Mar 2025 21:23:22 +0800
Message-ID: <cover.1742043963.git.hako@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Andrew Tropin <andrew@HIDDEN>, Janneke Nieuwenhuizen <janneke@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Tanguy Le Carrour <tanguy@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a01:4f8:10b:392::42;
 envelope-from=hako@HIDDEN; helo=mx.boiledscript.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi Guix,

Here's a patch series following my comments in https://issues.guix.gnu.org/63009#10,

Currently on a Guix System, PATH entries is in the following order:
--8<---------------cut here---------------start------------->8---
~/.guix-home/profile/bin
~/.guix-home/profile/sbin
/run/privileged/bin
~/.config/guix/current/bin
~/.guix-home/profile/bin
~/.guix-home/profile/sbin
~/.guix-profile/bin
~/.guix-profile/sbin
/run/current-system/profile/bin
/run/current-system/profile/sbin
--8<---------------cut here---------------end--------------->8---

With this change, it will be changed to:
--8<---------------cut here---------------start------------->8---
/run/privileged/bin
~/.config/guix/current/bin
~/.guix-profile/bin
~/.guix-profile/sbin
~/.guix-home/profile/bin
~/.guix-home/profile/sbin
/run/current-system/profile/bin
/run/current-system/profile/sbin
--8<---------------cut here---------------end--------------->8---

I haven't changed guix-install.sh yet, so the following remains on foregin
distros:
--8<---------------cut here---------------start------------->8---
~/.guix-home/profile/bin
~/.guix-home/profile/sbin
~/.guix-profile/bin
~/.guix-profile/sbin
--8<---------------cut here---------------end--------------->8---

If you agree with [PATCH 1/2], I'll change guix-install.sh too.

Thanks

Hilton Chain (2):
  gnu: system: Order imperative profiles first in etc/profile.
  home: setup-environment: Avoid prepending duplicated PATH.

 gnu/home/services.scm | 14 +++++++++++++-
 gnu/system.scm        |  6 +++---
 2 files changed, 16 insertions(+), 4 deletions(-)


base-commit: 3cc51c3e7447ab4f590d530fa66f65b6152ab109
--
2.48.1




Acknowledgement sent to Hilton Chain <hako@HIDDEN>:
New bug report received and forwarded. Copy sent to andrew@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to andrew@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN:
bug#77035; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 4 Apr 2025 03:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.