Subject: [bug#68169] [PATCH 2/9] system: Export default zprofile.

From: Efraim Flashner <[email-masked]>
Date: Sun, 31 Dec 2023 13:39:41 +0200

* gnu/system/shadow.scm (%default-zprofile): Extract from
default-skeletons, export.
(default-skeletons): Use %default-zprofile.

Change-Id: I6c6e158bca2e462a2eae709fbc2c25a2c7f3f8b4
---
 gnu/system/shadow.scm | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index cd4e1a9156..9b1678c54d 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -65,6 +65,7 @@ (define-module (gnu system shadow)
 
   #:export (%default-bashrc
             %default-bash-profile
+            %default-zprofile
             default-skeletons
             skeleton-directory
             %base-groups
@@ -166,25 +167,28 @@ (define %default-bash-profile
 export PATH=/run/setuid-programs:$PATH
 "))
 
+(define %default-zprofile
+  (plain-file "zprofile" "\
+# Honor system-wide environment variables
+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
+"))
+
 (define (default-skeletons)
   "Return the default skeleton files for /etc/skel.  These files are copied by
 'useradd' in the home directory of newly created user accounts."
 
-  (let ((profile %default-bash-profile)
-        (bashrc  %default-bashrc)
-        (zprofile    (plain-file "zprofile" "\
-# Honor system-wide environment variables
-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
-"))
+  (let ((profile   %default-bash-profile)
+        (bashrc    %default-bashrc)
+        (zprofile  %default-zprofile)
         (xdefaults (plain-file "Xdefaults" "\
 XTerm*utf8: always
 XTerm*metaSendsEscape: true\n"))
-- 
Efraim Flashner   <[email-masked]>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted