GNU bug report logs - #77526
[PATCH v4 3/6] system: /etc/profile: Set up extra environment variables for Guix Home.

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 #77035, #77522, #77523, #77524, #77525, #77527, #77528; dated Fri, 4 Apr 2025 03:24:06 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 submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Apr 2025 03:23:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 03 23:23:57 2025
Received: from localhost ([127.0.0.1]:36546 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u0Xeu-0002bN-RZ
	for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 23:23:57 -0400
Received: from lists.gnu.org ([2001:470:142::17]:32922)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1u0Xeo-0002a2-CI
 for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 23:23:53 -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 1u0Xei-0006su-QO
 for guix-patches@HIDDEN; Thu, 03 Apr 2025 23:23:44 -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 1u0Xeh-0002hu-7x
 for guix-patches@HIDDEN; Thu, 03 Apr 2025 23:23:44 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743737021;
 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=tm9Lvhwm7Z/F7x6u5dWGMXUbr4UiI1vKjwS8fQdmtt0=;
 b=Mtr+xzaDPlPyNGlIt4cVLD9OQNyLWE1CwfTmBXcoKyXXvzDYpcHz/V+Qe+ONJQ91d4HvDE
 PGQkO2RketzqtqrwVal5Phbtuhk4ZG4nyBX5pfzyBzo1IOB+eOR54tZbmu+pkCz61NmlGv
 MWOivYO2RDrBXDARbpoBaK91QG8+VXWmZPKrZ0B1uSrItjhERBhRFPA8pwJMyIzetX2J3R
 x2A0DCdDIZceW0cGKWxgARjFfgkqJturp+rC5rvsguas6DZGS6k7ykiHVV3qcdfTtQfdNv
 9w0+NmnmZFYkmLQFLkY+Nf/BpYQISssTJ204+HMwkniy+VYuKaFeG6O7wxEYzQ==
To: guix-patches@HIDDEN
Subject: [PATCH v4 3/6] system: /etc/profile: Set up extra environment
 variables for Guix Home.
Date: Fri,  4 Apr 2025 11:23:00 +0800
Message-ID: <23fcef43612216d58882c304ec255d2fbb816509.1743736516.git.hako@HIDDEN>
In-Reply-To: <cover.1743736516.git.hako@HIDDEN>
References: <cover.1743736516.git.hako@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Andrew Tropin <andrew@HIDDEN>, Hilton Chain <hako@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 (/)

* 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 46e6729e74..b67d26b648 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1148,6 +1148,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 search paths not in a profile.
 export PATH=/run/privileged/bin:$PATH
 export XCURSOR_PATH=\"$HOME/.icons:$XCURSOR_PATH\"
-- 
2.49.0





Acknowledgement sent to Hilton Chain <hako@HIDDEN>:
New bug report received and forwarded. Copy sent to andrew@HIDDEN, hako@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to andrew@HIDDEN, hako@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN:
bug#77526; 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.