From debbugs-submit-bounces@debbugs.gnu.org Wed May 17 10:04:35 2023 Received: (at 20255) by debbugs.gnu.org; 17 May 2023 14:04:35 +0000 Received: from localhost ([127.0.0.1]:50527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzHlb-0002A4-8l for submit@debbugs.gnu.org; Wed, 17 May 2023 10:04:35 -0400 Received: from mail.envs.net ([5.199.136.28]:38250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzHlN-000291-VI for 20255@debbugs.gnu.org; Wed, 17 May 2023 10:04:33 -0400 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 735D038A1431; Wed, 17 May 2023 14:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1684332261; bh=4lP/qre2fEH84WVMWGLGqsYIMtbrdYvn2xbmWwDrfGE=; h=From:To:Cc:Subject:Date:From; b=ip8PHuF/mPtSqAgAZg8dn00LNOYw7KyjQRpnDxKeDqAk0cT7ecgP7gZxTasDYyw1C K/hZeL4eWZyDbkdFX8X/XN6u3jfIUiK9zMYiGRMOfGsm4jtDOyGXN9ZGBPFz0PqsmQ JmtiohoRitgmqIiG3wc3RBwpMRdSp5pBEVjgiNIH+l/4Um8+RRQLiHM8GwTaGxWJsD b9fIryi2o26jfsBTiPL+fh/kEp9oR660A/DewBsjYARiH7vXWSvrgBv3YR34GUiyAI LI4dH08s4FowN2Rtee27iuXbePYCm4TTVVYs0vy5S+oUu9byTnPWYDdrj1uxEZ71Sj lo9vi2f+G4Lk9TeVybAJDrnqBGBqOFTtryJYISN7FwsN/icR6SEwMqCuhvm9NKExzV K6o9vbZTmGXUreZC1QeO/Z9CVjvWyuv+ZqC8/e4zg/Psoo854EKvQTXXM1FpH/I6GD GevxI0JnPBH937BkLnxqXlDs3PrLQ1fxW9efZJ19jlCEB0v+Ta4Vqn01mnvJPYny9C 7okJ19G9Q9ajRF9qM6Mraa2Ne0UoP8Hzjy9MaTHjEaabtqaalm2w6OXB8isCat6DF5 YC19pJH7+kObw5CoDy3leOv+yXP0iVFXsKeoe0GBryQwacMetBd8Of7W9iaK9skzPm yAZHXq/EcsbdRgKiM7aja2Z0= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WuZSTcPUxNtm; Wed, 17 May 2023 14:04:18 +0000 (UTC) Received: from localhost (unknown [36.170.57.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Wed, 17 May 2023 14:04:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id bacb00de; Wed, 17 May 2023 14:04:18 +0000 (UTC) From: iyzsong@envs.net To: 20255@debbugs.gnu.org Subject: [PATCH 1/4] home: shells: Merge search-paths of multiple profiles. Date: Wed, 17 May 2023 22:04:08 +0800 Message-Id: <10665650174637a1b70629b864509a0a68920154.1684331588.git.iyzsong@member.fsf.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Debbugs-Cc: ( , Andrew Tropin , Ludovic Courtès Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20255 Cc: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) From: 宋文武 This is a followup to 40310efde9b4a4f2cf98081d6cd10f843685ebb6. * gnu/home/services.scm (environment-variables->setup-environment-script): Merge search-paths from multiple profiles via "guix package". * gnu/home/services/shells.scm (zsh-file-zprofile, add-bash-configuration): Adjust comments. --- gnu/home/services.scm | 14 ++++++++++---- gnu/home/services/shells.scm | 6 ++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gnu/home/services.scm b/gnu/home/services.scm index b17a34d19d..3a061cf310 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -260,11 +260,17 @@ (define (environment-variables->setup-environment-script vars) (lambda (port) (set-port-encoding! port "UTF-8") (display "\ -HOME_ENVIRONMENT=$HOME/.guix-home -GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\" -PROFILE_FILE=\"$HOME_ENVIRONMENT/profile/etc/profile\" -[ -f $PROFILE_FILE ] && . $PROFILE_FILE +# 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 +HOME_ENVIRONMENT=$HOME/.guix-home case $XDG_DATA_DIRS in *$HOME_ENVIRONMENT/profile/share*) ;; *) export XDG_DATA_DIRS=$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DIRS ;; diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm index f05f2221d6..7c8908083e 100644 --- a/gnu/home/services/shells.scm +++ b/gnu/home/services/shells.scm @@ -185,9 +185,8 @@ (define (zsh-file-zprofile config) (mixed-text-file "zprofile" "\ -# Set up the system, user profile, and related variables. +# Set up environment variables of profiles. source /etc/profile -# Set up the home environment profile. source ~/.profile # It's only necessary if zsh is a login shell, otherwise profiles will @@ -399,9 +398,8 @@ (define (add-bash-configuration config) ,(mixed-text-file "bash_profile" "\ -# Set up the system, user profile, and related variables. +# Set up environment variables of profiles. # /etc/profile will be sourced by bash automatically -# Set up the home environment profile. if [ -f ~/.profile ]; then source ~/.profile; fi # Honor per-interactive-shell startup file base-commit: cf82526ac400fe953ddfbf9d7458d62ea4871d10 -- 2.40.1