From patchwork Mon Mar 31 16:25:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 41084 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CC14727BBEA; Mon, 31 Mar 2025 17:27:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C8F9C27BBE2 for ; Mon, 31 Mar 2025 17:27:19 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzHyd-0004Vb-19; Mon, 31 Mar 2025 12:27:07 -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 ) id 1tzHyb-0004VP-8Q for guix-patches@gnu.org; Mon, 31 Mar 2025 12:27:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tzHya-0001Ew-TP; Mon, 31 Mar 2025 12:27:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=fbZvvBXbHWjJEHnEZj38fBMgpGPNTGYJv8k22tAAn3g=; b=ufkez5RNMK9/+ptWf/x5ymyiG7lAWhsvSN3Nlf2sLK8QP1lpRuZ0wJV88mpcgBBa7ynyxhWCAwlmiFduNU4j6FJVgKeuy4gbHv/GOKndgoIbimU5FdKUcv8rR1DgE7IcqShHiiDtbzBRFEIFptwOPkTd8dpl042THic12zrcAmAPr4mVFZWEJbExH/4dos7SObvgwARsmo4IyMShtZdPjLWArGhUPIhXTyqxOd5yGxEL7sdo4ZY2aa1x+tOlbA4GEgnTDZ9jllC+/rcLx0w9HtMZ0mtOOV9wsKffjcce3WXSiRJyGMrCmcad/21bN/0VgKVqhLpN0WNhI09QYL8MIw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tzHya-0005vM-1i; Mon, 31 Mar 2025 12:27:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77035] [PATCH v2 3/3] guix-install.sh: /etc/profile.d/zzz-guix.sh: Handle Guix Home profile. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Mon, 31 Mar 2025 16:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77035 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77035@debbugs.gnu.org Cc: Hilton Chain , Hilton Chain , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Hilton Chain , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77035-submit@debbugs.gnu.org id=B77035.174343841922730 (code B ref 77035); Mon, 31 Mar 2025 16:27:04 +0000 Received: (at 77035) by debbugs.gnu.org; 31 Mar 2025 16:26:59 +0000 Received: from localhost ([127.0.0.1]:42594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tzHyU-0005uS-RK for submit@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 ) id 1tzHyQ-0005tr-UP for 77035@debbugs.gnu.org; Mon, 31 Mar 2025 12:26:55 -0400 From: Hilton Chain 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== Date: Tue, 1 Apr 2025 00:25:58 +0800 Message-ID: <043b31de365ae667a9d7d5588f228b94eb27e267.1743438266.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 X-MS-Reactions: disallow X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 }