From patchwork Fri Apr 4 03:22:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 41256 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 4583827BBEA; Fri, 4 Apr 2025 04:24:27 +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 6CD4227BBE2 for ; Fri, 4 Apr 2025 04:24:26 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0Xf9-0006va-FJ; Thu, 03 Apr 2025 23:24:11 -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 1u0Xf2-0006v8-LI for guix-patches@gnu.org; Thu, 03 Apr 2025 23:24: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 1u0Xf2-0002lT-Cf for guix-patches@gnu.org; Thu, 03 Apr 2025 23:24: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=d0tH94RRK/KrRDzwZPVwFrDUHNaidGFC1Mjnjv4ImOs=; b=hzx2+isvlwhPuodq3r4P8UyKaUbGxfx5rYJ6nQ0UkF7d9ccvKmnJBsxsHrPXLKj9+k3+DkI0BV5y0k82OoTh+hVdHRNc/irLAE8hn+CwaTDmBbtBZh3n/hkRovFvBn5sekat/jjtfSYbiJsTVsUOwiNcEETwHJ6jVFzmxnO0vKS1InveHULC4fA6+EAM2153rg6lm9RwzZQVZfCHm0bN2ZoI8m0f4Gi/jpSfckM6Gc1w+hTRrS5z6Pt2AMYYC9rt8u8/Q9vjz0vp625iYqQCiGEY+n+wMGerxpHEaNMj0t9tL2+7rphHCs8z5L7SVEuhcnSYcm1IXyqjWTa2cYJSfw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u0Xf2-0002cF-5j for guix-patches@gnu.org; Thu, 03 Apr 2025 23:24:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77523] [PATCH v4 1/6] system: /etc/profile: Group profile sourcing. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 04 Apr 2025 03:24:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77523 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77523@debbugs.gnu.org Cc: Hilton Chain X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17437370319962 (code B ref -1); Fri, 04 Apr 2025 03:24:03 +0000 Received: (at submit) by debbugs.gnu.org; 4 Apr 2025 03:23:51 +0000 Received: from localhost ([127.0.0.1]:36537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u0Xeo-0002ab-QE for submit@debbugs.gnu.org; Thu, 03 Apr 2025 23:23:51 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49132) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u0Xel-0002Zy-Tf for submit@debbugs.gnu.org; Thu, 03 Apr 2025 23:23:48 -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 1u0Xeg-0006sO-BD for guix-patches@gnu.org; Thu, 03 Apr 2025 23:23:42 -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 ) id 1u0Xee-0002hH-HF for guix-patches@gnu.org; Thu, 03 Apr 2025 23:23:42 -0400 From: Hilton Chain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=mail; t=1743737017; 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=d0tH94RRK/KrRDzwZPVwFrDUHNaidGFC1Mjnjv4ImOs=; b=Gk+xzcD+xBISwfLKRgaiORzZIR+sJ3NlkLciSgUm9Nm1sfzzJEf3rRoEEr5QT4hHA6KGs5 3vbbsIDb1nIeFwVG5dppzGYKemCuI8v4l/jngLcSNVo9n4vuJYzi7is+EjdPHRVHzOTgSc Ai2lPQGDGMssuX23SwnXZYp20CujwkQmMeuF8v3sn7LtOS2E4HeNLt/IMYzr55oNE750p0 45pEigS9GC4J7C6n4KmjotUrkehnKp6QfwNT+ddbeNbiW7rO4EDrrfWshP/mcBYC5mxBnj b37zZX8ziveEc2eIuFSydwmUPVb2olkLjmWz2py/rgQR6UukTm3Ly9UdvIc2Dg== Date: Fri, 4 Apr 2025 11:22:58 +0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2a01:4f8:10b:392::42; envelope-from=hako@ultrarare.space; 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-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]: Group sourcing of all default profiles. Order Guix Home search paths before the default user profile. 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