unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: iyzsong--- via Guix-patches via <guix-patches@gnu.org>
To: 61358@debbugs.gnu.org
Cc: 宋文武 <iyzsong@member.fsf.org>
Subject: [bug#61358] [PATCH] system: default-skeletons: Merge search-paths of multiple profiles.
Date: Wed,  8 Feb 2023 10:37:35 +0800	[thread overview]
Message-ID: <20230208023735.8388-1-iyzsong@envs.net> (raw)

From: 宋文武 <iyzsong@member.fsf.org>

Fixes <https://issues.guix/gnu.org/20255>.

* gnu/system/shadow.scm (default-skeletons)[bash_profile, zprofile]:
Merge search-paths from multiple profiles via "guix package".
---
 gnu/system/shadow.scm | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 2e87928368..a46f53e784 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -152,11 +152,31 @@ (define (default-skeletons)
 
   (let ((profile (plain-file "bash_profile" "\
 # Honor per-interactive-shell startup file
-if [ -f ~/.bashrc ]; then . ~/.bashrc; fi\n"))
+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-profile \\
+-p /run/current-system/profile)\"
+
+# Prepend setuid programs.
+export PATH=/run/setuid-programs:$PATH
+"))
         (bashrc  %default-bashrc)
         (zprofile    (plain-file "zprofile" "\
 # Honor system-wide environment variables
-source /etc/profile\n"))
+source /etc/profile
+
+# Merge search-paths from multiple profiles, the order matters.
+eval \"$(guix package --search-paths \\
+-p $HOME/.config/guix/current \\
+-p $HOME/.guix-profile \\
+-p /run/current-system/profile)\"
+
+# Prepend setuid programs.
+export PATH=/run/setuid-programs:$PATH
+"))
         (xdefaults (plain-file "Xdefaults" "\
 XTerm*utf8: always
 XTerm*metaSendsEscape: true\n"))
-- 
2.39.1





             reply	other threads:[~2023-02-08  2:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08  2:37 iyzsong--- via Guix-patches via [this message]
2023-02-08  5:18 ` [bug#61358] [PATCH] system: default-skeletons: Merge search-paths of multiple profiles Liliana Marie Prikler
2023-02-08  7:20   ` 宋文武 via Guix-patches via
2023-05-12 12:30 ` bug#61358: " 宋文武 via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230208023735.8388-1-iyzsong@envs.net \
    --to=guix-patches@gnu.org \
    --cc=61358@debbugs.gnu.org \
    --cc=iyzsong@envs.net \
    --cc=iyzsong@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).