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