From patchwork Tue Apr 1 15:02:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 41131 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 8F1FD27BBEA; Tue, 1 Apr 2025 16:04:50 +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=-6.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_MSPIKE_H2, 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 480E527BBE2 for ; Tue, 1 Apr 2025 16:04:50 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzd9q-00085O-9G; Tue, 01 Apr 2025 11:04:06 -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 1tzd9n-000848-RP for guix-patches@gnu.org; Tue, 01 Apr 2025 11:04:04 -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 1tzd9n-000346-EQ; Tue, 01 Apr 2025 11:04:03 -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=gZ/VPZyNTh65luBlyPNsnY5BjaCh+Pz0862e/RBsRhk=; b=A7n1k6Cs4DWbTZuCL0I41d4BzPwn+umbr3Zrl3hBG82Qt4gP1FORSeiiqJeNh0fnuA8dyIbzNO3gjFaUJmIxN4OjAUhRRAupoq0OSBnx9tVAnp1AKcYY2iHljuaN2IthECGWLqhjDAQF30aAHt77+RZ0FbA+fph3b0T+b7PTdaPuMaPzG2bVbBQRGT6B9iY+tpKd5d9NZMhmJpWKhIQWiUkQVWRj2cTMKFMRgnl1ZWy1lQ5UdA3hVq3jXbkFGuvGC4NmjMXs2tvz3A0t3yfFz+uaSQzdzRqLd7Xw8UYBw82EYAIKEDkG772V9vSONXUHy4UKMxpETpPyulr9SNHIdw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tzd9n-0004Bs-4j; Tue, 01 Apr 2025 11:04:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77035] [PATCH v3 1/5] system: /etc/profile: Set up all default profiles in one iteration. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Tue, 01 Apr 2025 15:04:03 +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.174351983516038 (code B ref 77035); Tue, 01 Apr 2025 15:04:03 +0000 Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:03:55 +0000 Received: from localhost ([127.0.0.1]:50016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tzd9f-0004Aa-DS for submit@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 ) id 1tzd9X-00049j-Um for 77035@debbugs.gnu.org; Tue, 01 Apr 2025 11:03:48 -0400 From: Hilton Chain 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== Date: Tue, 1 Apr 2025 23:02:44 +0800 Message-ID: <8e99166202077cc58e29db4ece30dbd5bb8d7d8b.1743519525.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 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 * 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 . # 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 From patchwork Tue Apr 1 15:02:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 41129 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 9A8CE27BBEA; Tue, 1 Apr 2025 16:04:48 +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=-6.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_MSPIKE_H2, 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 D55A027BBE2 for ; Tue, 1 Apr 2025 16:04:45 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzd9q-00085a-Eo; Tue, 01 Apr 2025 11:04:06 -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 1tzd9o-00084o-EI for guix-patches@gnu.org; Tue, 01 Apr 2025 11:04:04 -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 1tzd9o-00034F-3N; Tue, 01 Apr 2025 11:04: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=6XZY0UxXtrqDwpAwWtGpj7IGxWacYvVcVdj1piY/gr8=; b=t/FFjcd5eVmjiZlb54htJkpghaEVBccLtgCLUracjcNDLP9rISy4dZ/VnSaAhMsoRNjJjthBIlScnjgBqQ5vpupyvQQp+u+vmS/d01FXZx+cptHNQ0U8+Yp1jQLH6/Vo1DAJez7VNxFwL0x1saDWIu3OrJR4TsqDZDJDgArtsCg/vhMknfrLL2sKKkr2/HpCraSA3g+Bbnnxz6vdUyG4kIj26Q/1sg4U6duzilzBxVZeIkWYyhK0eEyKz9tOuIUiTOpryD8XCppOHjnfG3KmeJBD53Y6DQOTohp1vkmct6G2JkKKJB6+803lhiJPqInhSK1lSVdRDkoTPVPxgRHiUA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tzd9n-0004C3-Ra; Tue, 01 Apr 2025 11:04:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77035] [PATCH v3 2/5] system: Rearrange /etc/profile. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Tue, 01 Apr 2025 15:04:03 +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.174351983616047 (code B ref 77035); Tue, 01 Apr 2025 15:04:03 +0000 Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:03:56 +0000 Received: from localhost ([127.0.0.1]:50018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tzd9f-0004Aj-UH for submit@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 ) id 1tzd9b-0004A5-Sm for 77035@debbugs.gnu.org; Tue, 01 Apr 2025 11:03:52 -0400 From: Hilton Chain 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== Date: Tue, 1 Apr 2025 23:02:45 +0800 Message-ID: <61d3d34032d3dfcc71fff9f9e52093a65339065f.1743519525.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 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 * 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 . -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 -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 . +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 . + 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 + 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 . -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 From patchwork Tue Apr 1 15:02:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 41128 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 42B2F27BBEA; Tue, 1 Apr 2025 16:04:47 +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=-6.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_MSPIKE_H2, 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 E8AC727BBEC for ; Tue, 1 Apr 2025 16:04:45 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzd9t-000875-SS; Tue, 01 Apr 2025 11:04:09 -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 1tzd9q-00085i-Nz for guix-patches@gnu.org; Tue, 01 Apr 2025 11:04:06 -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 1tzd9p-00034d-9t; Tue, 01 Apr 2025 11:04:05 -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=lzE75rlE4EQDTJpvRSS+cLdyMuty8wZaVWM0MKTRSQ0=; b=hbuCohG/epPfqcaSDyQk7K9sOc30oNycEpCdcwvl9CE36BVccQIEE545x0SCZz3kCC1/2562NYm0MplXTSDOHFGj4h7AbzpZEMvpN0/S6xrqLojU/ECJ/A3jKO9/+bl0V0/O8FOAcDNWlji4wXQBBZMoP8HoZqxOl8gsFMUtLl9cJpWZd7Jou53rOxWser/Sh0tL20VAhlRah22O9xW00WBA6o6VmWLrDeYaImc8ZLDuIAA0YsLiH79MkZ3uBGHLSD/Bm0lTumHrH/Ns87KzRT5Mn6qElaJqwECyISyQfhugQ3+2jAfcFaJh7CzRCOPED2tlysAYAz9YBEiCCRHR5A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tzd9o-0004CK-ER; Tue, 01 Apr 2025 11:04:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77035] [PATCH v3 3/5] system: /etc/profile: Set up extra environment variables for Guix Home. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, ludo@gnu.org, andrew@trop.in, janneke@gnu.org, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Tue, 01 Apr 2025 15:04: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?= , Andrew Tropin , Janneke Nieuwenhuizen , Tanguy Le Carrour X-Debbugs-Original-Xcc: Hilton Chain , Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Tanguy Le Carrour Received: via spool by 77035-submit@debbugs.gnu.org id=B77035.174351984016074 (code B ref 77035); Tue, 01 Apr 2025 15:04:04 +0000 Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:04:00 +0000 Received: from localhost ([127.0.0.1]:50022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tzd9j-0004BC-Jb for submit@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 ) id 1tzd9h-0004Al-5q for 77035@debbugs.gnu.org; Tue, 01 Apr 2025 11:03:57 -0400 From: Hilton Chain 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== Date: Tue, 1 Apr 2025 23:02:46 +0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 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 * 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\" From patchwork Tue Apr 1 15:02:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 41130 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 EB60D27BBE2; Tue, 1 Apr 2025 16:04:48 +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=-6.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_MSPIKE_H2, 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 39C3027BBEE for ; Tue, 1 Apr 2025 16:04:46 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzdA2-00089c-TO; Tue, 01 Apr 2025 11:04:18 -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 1tzd9x-00087u-G5 for guix-patches@gnu.org; Tue, 01 Apr 2025 11:04:14 -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 1tzd9x-00035m-1K; Tue, 01 Apr 2025 11:04:13 -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=7XMI5drsteA7hQ1Jxg/umGkusBC47mbOclwLtcEHlM4=; b=TBVJurN0H2uMzAZB2Mn4pxnbcGkEoGByTAWckWUTHZpVAhSbS+NPkeSf4AF4jan1hCKH6xZZ8i+vBo/V9nne0jaulKnl0N9HCwtkBUD9Bbi74mFFFce+hTI7RaqCimbvkSkQ+7jb/GJTkxZBD9/BbLzHsHB1kZ7r7biAg4xs9MUqIxf3lc+YeROlK6I/ki2L/HLrLOX6wW+hCc3GAMcBdK19BdF0YUDtJW8Oxq9P1z8LJUzTD8HTuoZXMs5SQNdThpOs318oJxJjIIQzHux+mZAPKKCDiDYJkR/BuJuc89zFx1hGasPtMFHk/0FJIcCQH79eguGFWV6Nj97UKdo/VQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tzd9p-0004CV-3f; Tue, 01 Apr 2025 11:04:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77035] [PATCH v3 4/5] system & home: profile: Address issues reported by =?utf-8?b?4oCYc2hlbGxjaGVja+KAmS4=?= Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, ludo@gnu.org, andrew@trop.in, janneke@gnu.org, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Tue, 01 Apr 2025 15:04:05 +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?= , Andrew Tropin , Janneke Nieuwenhuizen , Tanguy Le Carrour X-Debbugs-Original-Xcc: Hilton Chain , Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Tanguy Le Carrour Received: via spool by 77035-submit@debbugs.gnu.org id=B77035.174351984416131 (code B ref 77035); Tue, 01 Apr 2025 15:04:05 +0000 Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:04:04 +0000 Received: from localhost ([127.0.0.1]:50028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tzd9n-0004Bu-5j for submit@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 ) id 1tzd9l-0004BK-3T for 77035@debbugs.gnu.org; Tue, 01 Apr 2025 11:04:02 -0400 From: Hilton Chain 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== Date: Tue, 1 Apr 2025 23:02:47 +0800 Message-ID: <10b0b9c1044b1ccc0954d902e9a4436e82a0a964.1743519525.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 * 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 . # 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 From patchwork Tue Apr 1 15:02:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 41132 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 46DAA27BBEA; Tue, 1 Apr 2025 16:05:14 +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=-6.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_MSPIKE_H2, 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 A24B027BBE2 for ; Tue, 1 Apr 2025 16:05:13 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzdAl-00009q-Pi; Tue, 01 Apr 2025 11:05:03 -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 1tzdAk-00009H-OH for guix-patches@gnu.org; Tue, 01 Apr 2025 11:05:02 -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 1tzdAk-0003B3-Dq; Tue, 01 Apr 2025 11:05:02 -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=P17vRpevmYS3yqSd0QeZRelC8Qv6dsRoXvXGfCNVjs4=; b=IubQN0+fu7k3rXuOpcLp5YCAu6a92JWwzjOfwUx2ioKev0duz8PbV3rHQkJacbUmtfdBxCw3XqXGtrak+r1vtCn74fRNsvJ7E10w/L6D46OPc4rWWzNv5XYkc+QvRlZQWhfhkj1FI1txsAMOpAENkB0ftz04v25zYAnbXdeJv0igiDWmmoWtRy7fOdD+4qJTqjzgL3mmojEm845oSu0pThmjQ9Sb6j4RLxJbGW7YZdu1Ssk12WLTeVkILpYziDYsxW3ZR015BRjld3aUffggeT3ioTCkgMMg/kwNI43yq5qPdlgFklYPttH7m7ZVUEZrzSO4sKA1lZ2hcFKNveyvSQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tzdAk-0004Jm-5S; Tue, 01 Apr 2025 11:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77035] [PATCH v3 5/5] guix-install.sh: Set up all default profiles in one iteration. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Tue, 01 Apr 2025 15:05:02 +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.174351985016213 (code B ref 77035); Tue, 01 Apr 2025 15:05:02 +0000 Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:04:10 +0000 Received: from localhost ([127.0.0.1]:50042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tzd9u-0004DK-2N for submit@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 ) id 1tzd9r-0004CT-MF for 77035@debbugs.gnu.org; Tue, 01 Apr 2025 11:04:08 -0400 From: Hilton Chain 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== Date: Tue, 1 Apr 2025 23:02:48 +0800 Message-ID: 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): 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 }