GNU bug report logs - #78308
[PATCH 0/9] VTE integration support / Shell startup files refactor

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Thu, 8 May 2025 05:49:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

To reply to this bug, email your comments to 78308 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, noelopez <at> free.fr, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 05:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, noelopez <at> free.fr, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org. (Thu, 08 May 2025 05:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 0/9] VTE integration support / Shell startup files refactor
Date: Thu,  8 May 2025 14:47:54 +0900
The aim of this series was ultimately to add VTE integration support out of
the box, resolving <https://issues.guix.gnu.org/72172>.  In order to do so, I
introduce the new etc-profile-d-service-type and etc-bashrc-d-service-type
service types.

While at it, define SYS_BASHRC in our Bash package to treat /etc/bashrc as a
first class startup file, and get rid of /etc/skel/.bashrc, whose
functionality is moved to /etc/bashrc or /etc/bashrc.d/aliases.sh and
/etc/bashrc.d/bash_completion.sh.

To test, I've used:

--8<---------------cut here---------------start------------->8---
make check-system TESTS='basic openssh dropbear'
--8<---------------cut here---------------end--------------->8---

as well as live testing in a GNOME desktop VM to validate the VTE integration.

Thank you,

Maxim Cournoyer (9):
  system: Source scripts from the /etc/profile.d directory.
  services: Add etc-profile-d-service-type.
  gnu: bash: Define the SYS_BASHRC macro.
  system: Source scripts from the /etc/bashrc.d directory.
  services: Add etc-bashrc-d-service-type.
  system: Migrate sourcing bash_completion.sh to
    etc-bashrc-d-service-type.
  system: Factorize bashrc default configuration.
  services: Add vte-integration-service-type.
  services: Add vte-integration-service-type to %desktop-services.

 doc/guix.texi                |  57 ++++++++++++++++-
 gnu/home/services/shells.scm |  14 ++---
 gnu/packages/bash.scm        |  20 ++++++
 gnu/services.scm             | 116 +++++++++++++++++++++++++++++++++++
 gnu/services/base.scm        |   5 +-
 gnu/services/desktop.scm     |   4 ++
 gnu/system.scm               |  43 ++++++-------
 gnu/system/shadow.scm        |  21 +++----
 gnu/tests/base.scm           |  45 +++++++++++++-
 9 files changed, 278 insertions(+), 47 deletions(-)


base-commit: 9d9a6291c4e61f3af71e94e549926bd9905e99db
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 1/9] system: Source scripts from the /etc/profile.d directory.
Date: Thu,  8 May 2025 15:02:17 +0900
This is useful since our /etc/profile file is otherwise not easily
extendable.

* gnu/system.scm (operating-system-etc-service): Source all '.sh' ending
files found under the /etc/profile.d directory.

Change-Id: Ia6d777195241f69219f00fbd5975e3e6b7c265fb
---
 gnu/system.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/system.scm b/gnu/system.scm
index bc652b1ce59..11ac22da5a0 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1122,6 +1122,17 @@ (define* (operating-system-etc-service os)
 # Allow GStreamer-based applications to find plugins.
 export GST_PLUGIN_PATH=\"$HOME/.guix-profile/lib/gstreamer-1.0\"
 
+for i in /etc/profile.d/*.sh; do
+    if [ -r \"$i\" ]; then
+        if [ \"${-#*i}\" != \"$-\" ]; then
+            . \"$i\"
+        else
+            . \"$i\" >/dev/null
+        fi
+    fi
+done
+unset i
+
 if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
 then
   # Load Bash-specific initialization code.
-- 
2.49.0





Information forwarded to gabriel <at> erlikon.ch, ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:02 GMT) Full text and rfc822 format available.

Message #11 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 2/9] services: Add etc-profile-d-service-type.
Date: Thu,  8 May 2025 15:02:18 +0900
* gnu/services.scm (make-files->etc-directory)
(files->profile-d-entries): New procedures.
(etc-profile-d-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.
* gnu/tests/base.scm (run-basic-test): Test it.

Change-Id: I45dde43a1b9603c3384b933ebd1d6e45dba146b9
---
 doc/guix.texi      | 14 +++++++++++
 gnu/services.scm   | 62 ++++++++++++++++++++++++++++++++++++++++++++++
 gnu/tests/base.scm | 21 ++++++++++++++--
 3 files changed, 95 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 889eab2ab35..05124e8ce6f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47522,6 +47522,20 @@ Service Reference
 pointing to the given file.
 @end defvar
 
+@defvar etc-profile-d-service-type
+The type of the @file{/etc/profile.d} service.  This service is used to
+create files under @file{/etc/profile.d}.  It takes as value a list of
+file-like objects, as can be produced with @code{local-file},
+@code{plain-file}, etc.  Package objects can also be provided directly
+to have their @file{etc/profile.d/*.sh} prefixed files added.  A simple
+usage may look like:
+
+@example
+(service etc-profile-d-service-type
+         (list (plain-file "HOW_IMPORTANT=very")))
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index af054339fd9..8584b16ac5c 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2023 Brian Cully <bjc <at> spork.org>
 ;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu services)
+  #:use-module (guix derivations)
   #:use-module (guix gexp)
   #:use-module (guix monads)
   #:use-module (guix store)
@@ -120,6 +122,7 @@ (define-module (gnu services)
             special-files-service-type
             extra-special-file
             etc-service-type
+            etc-profile-d-service-type
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -926,6 +929,65 @@ (define-deprecated (etc-service files)
 FILES must be a list of name/file-like object pairs."
   (service etc-service-type files))
 
+(define (make-files->etc-directory name)
+  "Return a procedure that accept a list of FILES and compute a directory named NAME.
+The returned procedure FILES argument can be packages containing
+@file{etc/@var{name}.d/@var{x}.sh} scripts or single file-like objects of the
+@file{.sh} file extension.  The constructed procedure returns a list of
+two-elements list suitable for extending `etc-service-type'."
+  (lambda (files)
+    `((,name
+       ,(computed-file name
+         ;; This is specialized variant of `file-union'.
+         (with-imported-modules '((guix build utils))
+           #~(begin
+               (use-modules (guix build utils)
+                            (ice-9 ftw)
+                            (ice-9 match)
+                            (srfi srfi-1)
+                            (srfi srfi-26))
+
+               (define sh-files
+                 (append-map
+                  (lambda (f)
+                    (let* ((dir (format #f "~a/etc/~a" f #$name)))
+                      `(,@(if (file-exists? dir)
+                              (map (lambda (x)
+                                     (list x (string-append dir "/" x)))
+                                   (scandir dir
+                                            (cut string-suffix? ".sh" <>)))
+                              (if (string-suffix? ".sh" f)
+                                  (list (list (basename
+                                               (strip-store-file-name f)) f))
+                                  '())))))
+                  (list #$@files)))
+
+               (mkdir #$output)
+               (chdir #$output)
+
+               (map (match-lambda       ;XXX: adapted from file-union
+                      ((target source)
+                       ;; Stat the source to abort early if it does not exist.
+                       (stat source)
+                       (mkdir-p (dirname target))
+                       (symlink source target)))
+                    sh-files))))))))
+
+(define files->profile-d-directory
+  (make-files->etc-directory "profile.d"))
+
+(define etc-profile-d-service-type
+  (service-type
+   (name 'etc-profile-d)
+   (extensions (list (service-extension etc-service-type
+                                        files->profile-d-directory)))
+   (compose concatenate)
+   (extend append)
+   (default-value '())
+   (description "A service for populating @file{/etc/profile.d/} with POSIX
+scripts having the @file{.sh} file extension, to be sourced when users
+log in.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 20fc848e5ce..988212b4a7a 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016-2020, 2022, 2024-2025 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2018 Clément Lassieur <clement <at> lassieur.org>
-;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2022, 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2022 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2024 Dariqq <dariqq <at> posteo.net>
 ;;;
@@ -170,6 +170,14 @@ (define* (run-basic-test os command #:optional (name "basic")
 info --version")
                                     marionette)))
 
+          (test-assert "/etc/profile.d is sourced"
+            (zero? (marionette-eval '(system "
+. /etc/profile
+set -e -x
+test -f /etc/profile.d/test_profile_d.sh
+test \"$PROFILE_D_OK\" = yes")
+                                    marionette)))
+
           (test-equal "special files"
             '#$special-files
             (marionette-eval
@@ -563,7 +571,16 @@ (define* (test-basic-os #:optional (kernel linux-libre))
     (let* ((os  (marionette-operating-system
                  (operating-system
                    (inherit %simple-os)
-                   (kernel kernel))
+                   (kernel kernel)
+                   (services (cons (service
+                                    etc-profile-d-service-type
+                                    (list (plain-file
+                                           "test_profile_d.sh"
+                                           "export PROFILE_D_OK=yes\n")
+                                          (plain-file
+                                           "invalid-name"
+                                           "not a POSIX script -- ignore me")))
+                                   %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
            (vm  (virtual-machine os)))
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:02 GMT) Full text and rfc822 format available.

Message #14 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 3/9] gnu: bash: Define the SYS_BASHRC macro.
Date: Thu,  8 May 2025 15:02:19 +0900
This causes Bash to treat /etc/bashrc as a startup file, removing the need to
source /etc/bashrc from ~/.bashrc.

* gnu/packages/bash.scm (bash-fixed): New package, with added SYS_BASHRC
define.
(bash) [replacement]: Use it.
* gnu/system/shadow.scm (%default-bashrc): Do not source /etc/bashrc, now done
implicitly.

Change-Id: I5b0afd7d81653ef19c482e5501efdf7e50ef37c0
---
 gnu/packages/bash.scm | 20 ++++++++++++++++++++
 gnu/system/shadow.scm |  3 ---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index c88f38f5376..bcd78d7d2a9 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2024 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2024 chris <chris <at> bumblehead.com>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -137,6 +138,7 @@ (define-public bash
          (version "5.1"))
     (package
       (name "bash")
+      (replacement bash-fixed)
       (source (origin
                 (method url-fetch)
                 (uri (string-append
@@ -254,6 +256,24 @@ (define-public bash
       (license license:gpl3+)
       (home-page "https://www.gnu.org/software/bash/"))))
 
+(define bash-fixed
+  (package
+    (inherit bash)
+    (arguments
+     (substitute-keyword-arguments (package-arguments bash)
+       ((#:modules modules '%default-gnu-modules)
+        (append '((ice-9 receive)
+                  (srfi srfi-1)
+                  (srfi srfi-26))
+                modules))
+       ((#:configure-flags flags)
+        #~(receive (cppflags flags)
+              (partition (cut string-prefix? "CPPFLAGS" <>)
+                         #$flags)
+            (cons (string-append (first cppflags)
+                                 " -DSYS_BASHRC='\"/etc/bashrc\"'")
+                  flags)))))))
+
 (define-public bash-minimal
   ;; A stripped-down Bash for non-interactive use.
   (package/inherit bash
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index d0f1b6b2b14..50ac102707e 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -164,9 +164,6 @@ (define %default-bashrc
     return
 fi
 
-# Source the system-wide file.
-[ -f /etc/bashrc ] && source /etc/bashrc
-
 alias ls='ls -p --color=auto'
 alias ll='ls -l'
 alias grep='grep --color=auto'
-- 
2.49.0





Information forwarded to gabriel <at> erlikon.ch, ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:03 GMT) Full text and rfc822 format available.

Message #17 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 5/9] services: Add etc-bashrc-d-service-type.
Date: Thu,  8 May 2025 15:02:21 +0900
* gnu/services.scm (files->bashrc-d-directory) New procedure.
(etc-bashrc-d-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.
* gnu/tests/base.scm (test-basic-os): Test it.

Change-Id: Ibbb0f684de7aee296adedbce5b1192786d661af2
---
 doc/guix.texi      | 16 ++++++++++++++++
 gnu/services.scm   | 14 ++++++++++++++
 gnu/tests/base.scm | 39 ++++++++++++++++++++++++++++++---------
 3 files changed, 60 insertions(+), 9 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 05124e8ce6f..74503ce0e6c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47536,6 +47536,22 @@ Service Reference
 @end example
 @end defvar
 
+@defvar etc-bashrc-d-service-type
+The type of the @file{/etc/bashrc.d} service.  This service is used to
+create files under @file{/etc/bashrc.d}.  It takes as value a list of
+file-like objects, as can be produced with @code{local-file},
+@code{plain-file}, etc.  Package objects can also be provided directly
+to have their @file{etc/bashrc.d/*.sh} prefixed files added.  An example
+usage may look like:
+
+@example
+(use-package-modules gnome)     ;for the `vte' package
+
+(service etc-bashrc-d-service-type
+         (list (file-append vte "/etc/profile.d/vte.sh")))
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index 8584b16ac5c..7083c88c130 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -123,6 +123,7 @@ (define-module (gnu services)
             extra-special-file
             etc-service-type
             etc-profile-d-service-type
+            etc-bashrc-d-service-type
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -988,6 +989,19 @@ (define etc-profile-d-service-type
 scripts having the @file{.sh} file extension, to be sourced when users
 log in.")))
 
+(define files->bashrc-d-directory
+  (make-files->etc-directory "bashrc.d"))
+
+(define etc-bashrc-d-service-type
+  (service-type
+   (inherit etc-profile-d-service-type)
+   (name 'etc-bashrc-d)
+   (extensions (list (service-extension etc-service-type
+                                        files->bashrc-d-directory)))
+   (description "A service for populating @file{/etc/bashrc.d/} with Bash
+scripts having the @file{.sh} file extension, to be sourced by interactive
+Bash shells.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 988212b4a7a..edb7e9112ba 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -178,6 +178,19 @@ (define* (run-basic-test os command #:optional (name "basic")
 test \"$PROFILE_D_OK\" = yes")
                                     marionette)))
 
+          (test-assert "/etc/bashrc.d is sourced"
+            (zero? (marionette-eval
+                    '(system* "bash"
+                              ;; Ensure Bash runs interactively.
+                              "--init-file"
+                              #$(plain-file "test_bashrc_d.sh"
+                                            "\
+. /etc/bashrc
+set -e -x
+test -f /etc/bashrc.d/test_bashrc_d.sh
+test \"$BASHRC_D_OK\" = yes"))
+                    marionette)))
+
           (test-equal "special files"
             '#$special-files
             (marionette-eval
@@ -572,15 +585,23 @@ (define* (test-basic-os #:optional (kernel linux-libre))
                  (operating-system
                    (inherit %simple-os)
                    (kernel kernel)
-                   (services (cons (service
-                                    etc-profile-d-service-type
-                                    (list (plain-file
-                                           "test_profile_d.sh"
-                                           "export PROFILE_D_OK=yes\n")
-                                          (plain-file
-                                           "invalid-name"
-                                           "not a POSIX script -- ignore me")))
-                                   %base-services)))
+                   (services (cons* (service
+                                     etc-profile-d-service-type
+                                     (list (plain-file
+                                            "test_profile_d.sh"
+                                            "export PROFILE_D_OK=yes\n")
+                                           (plain-file
+                                            "invalid-name"
+                                            "not a POSIX script -- ignore me")))
+                                    (service
+                                     etc-bashrc-d-service-type
+                                     (list (plain-file
+                                            "test_bashrc_d.sh"
+                                            "export BASHRC_D_OK=yes\n")
+                                           (plain-file
+                                            "invalid-name"
+                                            "not a Bash script -- ignore me")))
+                                    %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
            (vm  (virtual-machine os)))
-- 
2.49.0





Information forwarded to gabriel <at> erlikon.ch, ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:03 GMT) Full text and rfc822 format available.

Message #20 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 6/9] system: Migrate sourcing bash_completion.sh to
 etc-bashrc-d-service-type.
Date: Thu,  8 May 2025 15:02:22 +0900
* gnu/system.scm (operating-system-etc-service): Remove block sourcing
bash_completion.sh.
(%base-packages-interactive): Delete bash-completion.
* gnu/services.scm (%default-etc-bashrc-d-files): New variable, which includes
the bash_completion.sh file.
(etc-bashrc-d-service-type): Use it.
* doc/guix.texi (Service Reference): Update documentation.

Change-Id: I2223a5f96f5d761148badc6be29e1c5c80465a1d
---
 doc/guix.texi    | 11 +++++++----
 gnu/services.scm |  8 +++++++-
 gnu/system.scm   | 10 ----------
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 74503ce0e6c..c8d74a3c31b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47540,15 +47540,18 @@ Service Reference
 The type of the @file{/etc/bashrc.d} service.  This service is used to
 create files under @file{/etc/bashrc.d}.  It takes as value a list of
 file-like objects, as can be produced with @code{local-file},
-@code{plain-file}, etc.  Package objects can also be provided directly
-to have their @file{etc/bashrc.d/*.sh} prefixed files added.  An example
-usage may look like:
+@code{plain-file}, etc.  The default value is made available via the
+@var{%default-etc-bashrc-d-files} variable for users to extended.
+Package objects can also be provided directly to have their
+@file{etc/bashrc.d/*.sh} prefixed files added.  An example usage may
+look like:
 
 @example
 (use-package-modules gnome)     ;for the `vte' package
 
 (service etc-bashrc-d-service-type
-         (list (file-append vte "/etc/profile.d/vte.sh")))
+         (append (list (file-append vte "/etc/profile.d/vte.sh"))
+                 %default-etc-bashrc-d-files))
 @end example
 @end defvar
 
diff --git a/gnu/services.scm b/gnu/services.scm
index 7083c88c130..5dbda176b80 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -124,6 +124,7 @@ (define-module (gnu services)
             etc-service-type
             etc-profile-d-service-type
             etc-bashrc-d-service-type
+            %default-etc-bashrc-d-files
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -992,6 +993,10 @@ (define etc-profile-d-service-type
 (define files->bashrc-d-directory
   (make-files->etc-directory "bashrc.d"))
 
+(define %default-etc-bashrc-d-files
+  (list (file-append bash-completion
+                     "/etc/profile.d/bash_completion.sh")))
+
 (define etc-bashrc-d-service-type
   (service-type
    (inherit etc-profile-d-service-type)
@@ -1000,7 +1005,8 @@ (define etc-bashrc-d-service-type
                                         files->bashrc-d-directory)))
    (description "A service for populating @file{/etc/bashrc.d/} with Bash
 scripts having the @file{.sh} file extension, to be sourced by interactive
-Bash shells.")))
+Bash shells.")
+   (default-value %default-etc-bashrc-d-files)))
 
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
diff --git a/gnu/system.scm b/gnu/system.scm
index 70f341a495a..d009a2036b0 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -959,7 +959,6 @@ (define %base-packages-interactive
         nvi
         man-db
         info-reader                     ;the standalone Info reader (no Perl)
-        bash-completion
         kbd
         ;; The 'sudo' command is already in %SETUID-PROGRAMS, but we also
         ;; want the other commands and the man pages (notably because
@@ -1146,15 +1145,6 @@ (define* (operating-system-etc-service os)
 # Provide a default prompt.  The user's ~/.bashrc can override it.
 PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
 
-# The 'bash-completion' package.
-if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ]
-then
-  # Bash-completion sources ~/.bash_completion.  It installs a dynamic
-  # completion loader that searches its own completion files as well
-  # as those in ~/.guix-profile and /run/current-system/profile.
-  source /run/current-system/profile/etc/profile.d/bash_completion.sh
-fi
-
 for i in /etc/bashrc.d/*.sh; do
     [[ -r $i ]] && source \"$i\"
 done
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:04 GMT) Full text and rfc822 format available.

Message #23 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 4/9] system: Source scripts from the /etc/bashrc.d directory.
Date: Thu,  8 May 2025 15:02:20 +0900
* gnu/system.scm (operating-system-etc-service): <bashrc>: Source scripts from
the /etc/bashrc.d directory.

Change-Id: I27a20a8eae5d736f32e0df55a68529d9bb613b7a
---
 gnu/system.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 11ac22da5a0..70f341a495a 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2020 Danny Milosavljevic <dannym <at> scratchpost.org>
 ;;; Copyright © 2020, 2021 Brice Waegeneire <brice <at> waegenei.re>
 ;;; Copyright © 2020 Florian Pelz <pelzflorian <at> pelzflorian.de>
-;;; Copyright © 2020, 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2020, 2022, 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <jannek <at> gnu.org>
 ;;; Copyright © 2020, 2022 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
@@ -1153,7 +1153,13 @@ (define* (operating-system-etc-service os)
   # completion loader that searches its own completion files as well
   # as those in ~/.guix-profile and /run/current-system/profile.
   source /run/current-system/profile/etc/profile.d/bash_completion.sh
-fi\n")))
+fi
+
+for i in /etc/bashrc.d/*.sh; do
+    [[ -r $i ]] && source \"$i\"
+done
+unset i
+")))
     (service etc-service-type
      `(("os-release" ,os-release)
        ("services" ,(file-append net-base "/etc/services"))
-- 
2.49.0





Information forwarded to gabriel <at> erlikon.ch, ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:04 GMT) Full text and rfc822 format available.

Message #26 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 8/9] services: Add vte-integration-service-type.
Date: Thu,  8 May 2025 15:02:24 +0900
* gnu/services.scm (vte-integration-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.

Change-Id: I7e4bc1b913b50a5a061894f9ddef27f1877b62a2
---
 doc/guix.texi    | 15 +++++++++++++++
 gnu/services.scm | 15 +++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 3c80ed24679..1eafd4eaa0e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47555,6 +47555,21 @@ Service Reference
 @end example
 @end defvar
 
+@defvar vte-integration-service-type
+This services adds the @file{/etc/bashrc.d/vte.sh} to your system, which
+improves the Bash and Zsh experience when using VTE-powered terminal
+emulators.  This causes for example the current directory to be
+displayed in the terminal emulator's tab title, and the current
+directory to be preserved when creating a new tab, among other features.
+The value of the service is the @code{vte} package to use.
+
+@example
+(use-package-modules gnome)     ;for the `vte' package
+
+(service vte-integration-service-type vte)
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index 159d357c3e7..ce15a39d063 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -47,6 +47,7 @@ (define-module (gnu services)
   #:use-module (guix deprecation)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages hurd)
   #:use-module (gnu packages linux)
   #:use-module (gnu system privilege)
@@ -138,6 +139,7 @@ (define-module (gnu services)
             linux-builder-configuration-kernel
             linux-builder-configuration-modules
             linux-loadable-module-service-type
+            vte-integration-service-type
 
             %boot-service
             %activation-service
@@ -1027,6 +1029,19 @@ (define etc-bashrc-d-service-type
 Bash shells.")
    (default-value %default-etc-bashrc-d-files)))
 
+(define vte-integration-service-type
+  (service-type
+   (name 'vte-integration)
+   (extensions
+    (list (service-extension etc-bashrc-d-service-type
+                             (lambda (vte)
+                               (list (file-append
+                                      vte "/etc/profile.d/vte.sh"))))))
+   (default-value vte)                  ;the vte package to use
+   (description "A service for adding the @file{/etc/bashrc.d/vte.sh} script
+to your system, which improves the Bash and Zsh experience when using
+VTE-powered terminal emulators.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
-- 
2.49.0





Information forwarded to andrew <at> trop.in, gabriel <at> erlikon.ch, hako <at> ultrarare.space, janneke <at> gnu.org, ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, tanguy <at> bioneland.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:05 GMT) Full text and rfc822 format available.

Message #29 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 7/9] system: Factorize bashrc default configuration.
Date: Thu,  8 May 2025 15:02:23 +0900
This factorizes out the remaining bashrc bits from /etc/skel/.bashrc to a the
template used for both /etc/bashrc on Guix System and ~/.bashrc for
home-bash-service-type.

Rationale: The use of /etc/skel introduce state: the file is only copied
originally when the user account is created, and never (automatically)
refreshed again.

* gnu/system.scm (operating-system-etc-service):
<profile>: Guard against souring /etc/bashrc in non-interactive, SSH case.
<bashrc>: Use %default-bashrc, having migrated the remaining definitions to...
* gnu/system/shadow.scm (%default-bashrc): ... here.  Factorize aliases to...
* gnu/services.scm (%default-bash-aliases): ... here.
(%default-bashrc-d-aliases): New variable.
(%default-etc-bashrc-d-files): Include it in the default configuration.
* gnu/services/base.scm (%base-services): Register etc-bashrc-d-service-type.
* gnu/home/services/shells.scm (add-bash-configuration): Do not set PS1, now
part of %default-bashrc.
(home-bash-configuration) [guix-defaults?]: Update doc.
[aliases]: Set %default-bash-aliases as the default value.  Update doc.
* doc/guix.texi (Shells Home Services): Update documentation.
(Service Reference): Update example.

Change-Id: I340c614983a78fd20a9c4a9705e7fc542ae9b513
---
 doc/guix.texi                | 19 +++++++++++--------
 gnu/home/services/shells.scm | 14 +++++++-------
 gnu/services.scm             | 23 +++++++++++++++++++++--
 gnu/services/base.scm        |  5 ++++-
 gnu/system.scm               | 24 +++++++-----------------
 gnu/system/shadow.scm        | 18 ++++++++++--------
 gnu/tests/base.scm           | 17 ++++++++++-------
 7 files changed, 70 insertions(+), 50 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index c8d74a3c31b..3c80ed24679 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47543,15 +47543,15 @@ Service Reference
 @code{plain-file}, etc.  The default value is made available via the
 @var{%default-etc-bashrc-d-files} variable for users to extended.
 Package objects can also be provided directly to have their
-@file{etc/bashrc.d/*.sh} prefixed files added.  An example usage may
-look like:
+@file{etc/bashrc.d/*.sh} prefixed files added.  Since the service is
+part @code{%base-services}, it can be extended via @code{simple-service}
+like so:
 
 @example
 (use-package-modules gnome)     ;for the `vte' package
 
-(service etc-bashrc-d-service-type
-         (append (list (file-append vte "/etc/profile.d/vte.sh"))
-                 %default-etc-bashrc-d-files))
+(simple-service 'vte-integration etc-bashrc-d-service-type
+                (list (file-append vte "/etc/profile.d/vte.sh")))
 @end example
 @end defvar
 
@@ -49177,8 +49177,11 @@ Shells Home Services
 The Bash package to use.
 
 @item @code{guix-defaults?} (default: @code{#t}) (type: boolean)
-Add sane defaults like reading @file{/etc/bashrc} and coloring the output of
-@command{ls} to the top of the @file{.bashrc} file.
+Add sane defaults like setting @env{PS1}, @env{SHELL}, and ensuring
+@file{/etc/profile} is sourced for non-interactive SSH shells.  If you
+use Guix System, is it safe to set this to @code{#f}, as in this case
+this is already taken care of by the globally installed
+@file{/etc/bashrc}.
 
 @item @code{environment-variables} (default: @code{'()}) (type: alist)
 Association list of environment variables to set for the Bash session.  The
@@ -49186,7 +49189,7 @@ Shells Home Services
 here (@pxref{Essential Home Services}).  The contents of this field will be
 added after the contents of the @code{bash-profile} field.
 
-@item @code{aliases} (default: @code{'()}) (type: alist)
+@item @code{aliases} (default: @code{%default-bash-aliases}) (type: alist)
 Association list of aliases to set for the Bash session.  The aliases
 will be defined after the contents of the @code{bashrc} field has been
 put in the @file{.bashrc} file.  The alias will automatically be quoted,
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index bab5730c3d6..969a3eb8dcf 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -20,6 +20,7 @@
 
 (define-module (gnu home services shells)
   #:use-module (gnu services configuration)
+  #:use-module ((gnu services) #:select (%default-bash-aliases))
   #:autoload   (gnu system shadow) (%default-bashrc %default-zprofile)
   #:use-module (gnu home services utils)
   #:use-module (gnu home services)
@@ -333,9 +334,12 @@ (define-configuration home-bash-configuration
    (package bash)
    "The Bash package to use.")
   (guix-defaults?
+   ;; TODO: Set to #f when the target system is determined to be Guix System.
    (boolean #t)
-   "Add sane defaults like reading @file{/etc/bashrc} and coloring the output of
-@command{ls} to the top of the @file{.bashrc} file.")
+   "Add sane defaults like setting @env{PS1}, @env{SHELL}, and ensuring
+@file{/etc/profile} is sourced for non-interactive SSH shells.  If you use
+Guix System, is it safe to set this to @code{#f}, as in this case this is
+already taken care of by the globally installed @file{/etc/bashrc}.")
   (environment-variables
    (alist '())
    "Association list of environment variables to set for the Bash session.  The
@@ -344,7 +348,7 @@ (define-configuration home-bash-configuration
 added after the contents of the @code{bash-profile} field."
    (serializer serialize-posix-env-vars))
   (aliases
-   (alist '())
+   (alist %default-bash-aliases)
    "Association list of aliases to set for the Bash session.  The aliases will be
 defined after the contents of the @code{bashrc} field has been put in the
 @file{.bashrc} file.  The alias will automatically be quoted, so something line
@@ -423,10 +427,6 @@ (define (add-bash-configuration config)
               'bashrc
               (if (home-bash-configuration-guix-defaults? config)
                   (list (plain-file-content %default-bashrc) "\n"
-                        ;; The host distro might provide a bad 'PS1'
-                        ;; default--e.g., not taking $GUIX_ENVIRONMENT into
-                        ;; account.  Provide a good default here when asked.
-                        "PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '\n"
                         (serialize-field 'aliases))
                   (list (serialize-field 'aliases))))
              (file-if-not-empty 'bash-logout)))))
diff --git a/gnu/services.scm b/gnu/services.scm
index 5dbda176b80..159d357c3e7 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -125,6 +125,7 @@ (define-module (gnu services)
             etc-profile-d-service-type
             etc-bashrc-d-service-type
             %default-etc-bashrc-d-files
+            %default-bash-aliases
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -993,9 +994,27 @@ (define etc-profile-d-service-type
 (define files->bashrc-d-directory
   (make-files->etc-directory "bashrc.d"))
 
+;;; Use an alist to be compatible with <home-bash-configuration>.
+(define %default-bash-aliases
+  '(("ls" . "ls -p --color=auto")
+    ("ll" . "ls -l")
+    ("grep" . "grep --color=auto")
+    ("ip" . "ip -color=auto")))
+
+;;; ... but avoid the full blown bash-serialize-aliases, which depends on
+;;; other 'guix home' definitions such as `shell-double-quote'.
+(define %default-bashrc-d-aliases
+  (plain-file "aliases.sh"
+              (string-join
+               (map (match-lambda
+                      ((alias . value)
+                       (format #f "~a=~s~%" alias value)))
+                    %default-bash-aliases)
+               "")))
+
 (define %default-etc-bashrc-d-files
-  (list (file-append bash-completion
-                     "/etc/profile.d/bash_completion.sh")))
+  (list (file-append bash-completion "/etc/profile.d/bash_completion.sh")
+        %default-bashrc-d-aliases))
 
 (define etc-bashrc-d-service-type
   (service-type
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index dfb96b1f0cc..adf456dc99e 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -4135,7 +4135,10 @@ (define %base-services
         (service mingetty-service-type (mingetty-configuration
                                          (tty "tty5")))
         (service mingetty-service-type (mingetty-configuration
-                                         (tty "tty6")))
+                                        (tty "tty6")))
+
+        ;; Extra Bash configuration including Bash completion and aliases.
+        (service etc-bashrc-d-service-type)
 
         (service static-networking-service-type
                  (list %loopback-static-networking))
diff --git a/gnu/system.scm b/gnu/system.scm
index d009a2036b0..ad37912f809 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1132,23 +1132,13 @@ (define* (operating-system-etc-service os)
 done
 unset i
 
-if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
-then
-  # Load Bash-specific initialization code.
-  . /etc/bashrc
+if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]; then
+  # Load Bash-specific initialization code, taking care to not source
+  # /etc/bashrc when invoked from a non-interactive SSH shell,
+  # to avoid recursion (/etc/bashrc also sources /etc/profile
+  # in the non-login, non-interactive SSH case).
+  [[ $- != *i* && -n $SSH_CLIENT ]] || source /etc/bashrc
 fi
-"))
-
-        (bashrc    (plain-file "bashrc" "\
-# Bash-specific initialization.
-
-# Provide a default prompt.  The user's ~/.bashrc can override it.
-PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
-
-for i in /etc/bashrc.d/*.sh; do
-    [[ -r $i ]] && source \"$i\"
-done
-unset i
 ")))
     (service etc-service-type
      `(("os-release" ,os-release)
@@ -1159,7 +1149,7 @@ (define* (operating-system-etc-service os)
        ("issue" ,issue)
        ,@(if nsswitch `(("nsswitch.conf" ,nsswitch)) '())
        ("profile" ,profile)
-       ("bashrc" ,bashrc)
+       ("bashrc" ,%default-bashrc)
        ;; Write the operating-system-host-name to /etc/hostname to prevent
        ;; NetworkManager from changing the system's hostname when connecting
        ;; to certain networks.  Some discussion at
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 50ac102707e..03af193f36f 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -146,8 +146,11 @@ (define %base-user-accounts
 
 (define %default-bashrc
   (plain-file "bashrc" "\
-# Bash initialization for interactive non-login shells and
-# for remote shells (info \"(bash) Bash Startup Files\").
+# Bash-specific initialization, including for non-login and remote
+# shells (info \"(bash) Bash Startup Files\").
+
+# Provide a default prompt.
+PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
 
 # Export 'SHELL' to child processes.  Programs such as 'screen'
 # honor it and otherwise use /bin/sh.
@@ -164,10 +167,11 @@ (define %default-bashrc
     return
 fi
 
-alias ls='ls -p --color=auto'
-alias ll='ls -l'
-alias grep='grep --color=auto'
-alias ip='ip -color=auto'\n"))
+for i in /etc/bashrc.d/*.sh; do
+    [[ -r $i ]] && source \"$i\"
+done
+unset i
+"))
 
 (define %default-bash-profile
   (plain-file "bash_profile" "\
@@ -288,12 +292,10 @@ (define (default-skeletons)
 'useradd' in the home directory of newly created user accounts."
 
   (let ((profile   %default-bash-profile)
-        (bashrc    %default-bashrc)
         (zprofile  %default-zprofile)
         (xdefaults %default-xdefaults)
         (gdbinit   %default-gdbinit))
     `((".bash_profile" ,profile)
-      (".bashrc" ,bashrc)
       ;; Zsh sources ~/.zprofile before ~/.zshrc, and it sources ~/.zlogin
       ;; after ~/.zshrc.  To avoid interfering with any customizations a user
       ;; may have made in their ~/.zshrc, put this in .zprofile, not .zlogin.
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index edb7e9112ba..85e5b954b90 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -187,6 +187,8 @@ (define* (run-basic-test os command #:optional (name "basic")
                                             "\
 . /etc/bashrc
 set -e -x
+test -f /etc/bashrc.d/bash_completion.sh
+test -f /etc/bashrc.d/aliases.sh
 test -f /etc/bashrc.d/test_bashrc_d.sh
 test \"$BASHRC_D_OK\" = yes"))
                     marionette)))
@@ -593,14 +595,15 @@ (define* (test-basic-os #:optional (kernel linux-libre))
                                            (plain-file
                                             "invalid-name"
                                             "not a POSIX script -- ignore me")))
-                                    (service
+                                    (simple-service
+                                     'extra-bashrc-d-files
                                      etc-bashrc-d-service-type
-                                     (list (plain-file
-                                            "test_bashrc_d.sh"
-                                            "export BASHRC_D_OK=yes\n")
-                                           (plain-file
-                                            "invalid-name"
-                                            "not a Bash script -- ignore me")))
+                                     (list  (plain-file
+                                             "test_bashrc_d.sh"
+                                             "export BASHRC_D_OK=yes\n")
+                                            (plain-file
+                                             "invalid-name"
+                                             "not a Bash script -- ignore me")))
                                     %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
-- 
2.49.0





Information forwarded to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, noelopez <at> free.fr, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Thu, 08 May 2025 06:37:05 GMT) Full text and rfc822 format available.

Message #32 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 9/9] services: Add vte-integration-service-type to
 %desktop-services.
Date: Thu,  8 May 2025 15:02:25 +0900
* gnu/services/desktop.scm (desktop-services-for-system):

Fixes: <https://issues.guix.gnu.org/72172>
Change-Id: Ib29468468e327801a4e95361610159de61f7e8d6
---
 gnu/services/desktop.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 2127c2d389c..ffa02063514 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -2458,6 +2458,10 @@ (define* (desktop-services-for-system #:optional
          ;; to avoid GDM stale cache and permission issues.
          gdm-file-system-service
 
+         ;; Provides a nicer terminal emulator experience for VTE-using
+         ;; terminal emulators such as GNOME Console, Xfce Terminal, etc.
+         (service vte-integration-service-type)
+
          ;; The global fontconfig cache directory can sometimes contain
          ;; stale entries, possibly referencing fonts that have been GC'd,
          ;; so mount it read-only.
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 12 May 2025 08:53:01 GMT) Full text and rfc822 format available.

Message #35 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Rutherther <rutherther <at> ditigal.xyz>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [PATCH 0/9] VTE integration support / Shell startup files refactor
Date: Mon, 12 May 2025 10:52:16 +0200
Hi Maxim,

thank you for this. I think it's important for users to be able to
extend their system profile and bashrc files, currently it was hard to
do. Basically the only way was to modify etc-service-type in
essential-services, removing the profile and bashrc completely, and
adding your own contents.

I have a few comments that I am posting before I actually tested it just
based on the changes:

I think that the docs for etc-profile-d-service-type could be more
specific about the files accepted - that only .sh files are going to
have some effect. Additionally the example plain-file is wrong,
plain-file accepts two arguments, name and content. Here the name is
quite important as it has to have the .sh extension for the file to be sourced.

As for the bash modification, is is a good idea to go through grafts?
Aren't grafts mainly meant for security fixes as to no changes are
introduced? How can we make sure this change is not going to break any
of the packages using bash? I understand we cannot rebuild the whole
world via this patch series if it is to be applied to master, but this
doesn't feel right, maybe those changes to bash should go on a team branch?

It's not super important, but do you happen to know why bash-completion
package provides profile.d directory for bash_completion.sh that should
actually be bashrc? Maybe it should be in etc/bashrc.d output dir
instead - that the package should be adapted?

I don't think removing the PS1 from guix home bashrc is appropriate. I think
the PS1 is mostly for foreign distros, not for Guix System, it's even
mentioned in the comment that it's for distros that don't provide a good PS1.
Similar question goes to removing sourcing of /etc/bashrc. Was this
because of Guix System or because of foreign distros? I don't know here.

Note that users not using %base-services are going to get no bash
completions after this update. Maybe there should be news entry about
the bashrc-d and profile-d services?

Regards
Rutherther




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 12 May 2025 13:13:01 GMT) Full text and rfc822 format available.

Message #38 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Rutherther <rutherther <at> ditigal.xyz>
Cc: 78308 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/9] VTE integration support / Shell startup files refactor
Date: Mon, 12 May 2025 22:12:26 +0900
Hi,

Rutherther <rutherther <at> ditigal.xyz> writes:

> Hi Maxim,
>
> thank you for this. I think it's important for users to be able to
> extend their system profile and bashrc files, currently it was hard to
> do. Basically the only way was to modify etc-service-type in
> essential-services, removing the profile and bashrc completely, and
> adding your own contents.

Glad to know that'll be useful!

> I have a few comments that I am posting before I actually tested it just
> based on the changes:
>
> I think that the docs for etc-profile-d-service-type could be more
> specific about the files accepted - that only .sh files are going to
> have some effect.  Additionally the example plain-file is wrong,
> plain-file accepts two arguments, name and content. Here the name is
> quite important as it has to have the .sh extension for the file to be sourced.

Thanks for spotting this.  I'll fix it, and emphasize more that only
files of the @file{.sh} extension are considered.

> As for the bash modification, is is a good idea to go through grafts?
> Aren't grafts mainly meant for security fixes as to no changes are
> introduced? How can we make sure this change is not going to break any
> of the packages using bash? I understand we cannot rebuild the whole
> world via this patch series if it is to be applied to master, but this
> doesn't feel right, maybe those changes to bash should go on a team branch?

A full world rebuild seems very expensive for this change alone.  The
only thing this switch does is cause Bash to source /etc/bashrc when it
also sources also ~/.bashrc.  Since there is no /etc/bashrc in the build
container, we shoud be good in terms of not breaking anything build wise.

> It's not super important, but do you happen to know why bash-completion
> package provides profile.d directory for bash_completion.sh that should
> actually be bashrc? Maybe it should be in etc/bashrc.d output dir
> instead - that the package should be adapted?

That seems to come from Fedora, and maybe other distributions, that have
this in their /etc/bashrc file:

--8<---------------cut here---------------start------------->8---
    # Only display echos from profile.d scripts if we are no login shell
    # and interactive - otherwise just process them to set envvars
    for i in /etc/profile.d/*.sh; do
        if [ -r "$i" ]; then
            if [ "$PS1" ]; then
                . "$i"
            else
                . "$i" >/dev/null
            fi
        fi
    done

    unset i
--8<---------------cut here---------------end--------------->8---

So on these systems, /etc/profile.d/ is used to extend Bash too.  That
means these scripts are limited to be POSIX-compliant, as /etc/profile
also source these, which seems an odd requirement to me for configuring
Bash :-).  In practice, what vte.sh does for example is check if the
Shell is Bash or Zsh, and return early if it isn't.  Not as clean as
having a /etc/bashrc.d, I'd say.  Let's start some new trend ;-).

> I don't think removing the PS1 from guix home bashrc is appropriate. I think
> the PS1 is mostly for foreign distros, not for Guix System, it's even
> mentioned in the comment that it's for distros that don't provide a good PS1.

It's not removed, but moved, as the change log says for the "system:
Factorize bashrc default configuration." commit:

--8<---------------cut here---------------start------------->8---
* gnu/home/services/shells.scm (add-bash-configuration): Do not set PS1, now
part of %default-bashrc.
--8<---------------cut here---------------end--------------->8---

Guix home uses the %default-bashrc, so it's covered.  It's something
I've tried paying attention to, it's good you saw that too.

> Similar question goes to removing sourcing of /etc/bashrc. Was this
> because of Guix System or because of foreign distros? I don't know here.

Both, I think!  The home-shell-service-type uses the bash package from
Guix, so it's safe to assume /etc/bashrc will now be sourced anytime
~/.bashrc is.

> Note that users not using %base-services are going to get no bash
> completions after this update. Maybe there should be news entry about
> the bashrc-d and profile-d services?

Good idea too!  I'll write one and send in a v2.

-- 
Thanks,
Maxim




Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:01 GMT) Full text and rfc822 format available.

Message #41 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 1/9] system: Source scripts from the /etc/profile.d
 directory.
Date: Tue, 13 May 2025 11:31:40 +0900
This is useful since our /etc/profile file is otherwise not easily
extendable.

* gnu/system.scm (operating-system-etc-service): Source all '.sh' ending
files found under the /etc/profile.d directory.

Change-Id: Ia6d777195241f69219f00fbd5975e3e6b7c265fb
---
 gnu/system.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/system.scm b/gnu/system.scm
index 2beca4b6d08..7db0ff5ba5e 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1122,6 +1122,17 @@ (define* (operating-system-etc-service os)
 # Allow GStreamer-based applications to find plugins.
 export GST_PLUGIN_PATH=\"$HOME/.guix-profile/lib/gstreamer-1.0\"
 
+for i in /etc/profile.d/*.sh; do
+    if [ -r \"$i\" ]; then
+        if [ \"${-#*i}\" != \"$-\" ]; then
+            . \"$i\"
+        else
+            . \"$i\" >/dev/null
+        fi
+    fi
+done
+unset i
+
 if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
 then
   # Load Bash-specific initialization code.

base-commit: 364694773ef1c61d4c9ec73e24f73642786486ca
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, gabriel <at> erlikon.ch, ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:02 GMT) Full text and rfc822 format available.

Message #44 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 2/9] services: Add etc-profile-d-service-type.
Date: Tue, 13 May 2025 11:31:41 +0900
* gnu/services.scm (make-files->etc-directory)
(files->profile-d-entries): New procedures.
(etc-profile-d-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.
* gnu/tests/base.scm (run-basic-test): Test it.

Change-Id: I45dde43a1b9603c3384b933ebd1d6e45dba146b9
---
 doc/guix.texi      | 16 ++++++++++++
 gnu/services.scm   | 62 ++++++++++++++++++++++++++++++++++++++++++++++
 gnu/tests/base.scm | 21 ++++++++++++++--
 3 files changed, 97 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 34092a2f735..2f80b2a0296 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47556,6 +47556,22 @@ Service Reference
 pointing to the given file.
 @end defvar
 
+@defvar etc-profile-d-service-type
+The type of the @file{/etc/profile.d} service.  This service is used to
+create files under @file{/etc/profile.d}.  It takes as value a list of
+file-like objects, as can be produced with @code{local-file},
+@code{plain-file}, etc.  Note that provided files whose file names do
+not end with @file{.sh} are @emph{not} added to @file{/etc/profile.d/}
+and are silently dropped.  Package objects can also be provided directly
+to have their @file{etc/profile.d/*.sh} prefixed files added.  A simple
+usage may look like:
+
+@example
+(service etc-profile-d-service-type
+         (list (plain-file "youppi.sh" HOW_IMPORTANT=very")))
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index af054339fd9..8584b16ac5c 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2023 Brian Cully <bjc <at> spork.org>
 ;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu services)
+  #:use-module (guix derivations)
   #:use-module (guix gexp)
   #:use-module (guix monads)
   #:use-module (guix store)
@@ -120,6 +122,7 @@ (define-module (gnu services)
             special-files-service-type
             extra-special-file
             etc-service-type
+            etc-profile-d-service-type
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -926,6 +929,65 @@ (define-deprecated (etc-service files)
 FILES must be a list of name/file-like object pairs."
   (service etc-service-type files))
 
+(define (make-files->etc-directory name)
+  "Return a procedure that accept a list of FILES and compute a directory named NAME.
+The returned procedure FILES argument can be packages containing
+@file{etc/@var{name}.d/@var{x}.sh} scripts or single file-like objects of the
+@file{.sh} file extension.  The constructed procedure returns a list of
+two-elements list suitable for extending `etc-service-type'."
+  (lambda (files)
+    `((,name
+       ,(computed-file name
+         ;; This is specialized variant of `file-union'.
+         (with-imported-modules '((guix build utils))
+           #~(begin
+               (use-modules (guix build utils)
+                            (ice-9 ftw)
+                            (ice-9 match)
+                            (srfi srfi-1)
+                            (srfi srfi-26))
+
+               (define sh-files
+                 (append-map
+                  (lambda (f)
+                    (let* ((dir (format #f "~a/etc/~a" f #$name)))
+                      `(,@(if (file-exists? dir)
+                              (map (lambda (x)
+                                     (list x (string-append dir "/" x)))
+                                   (scandir dir
+                                            (cut string-suffix? ".sh" <>)))
+                              (if (string-suffix? ".sh" f)
+                                  (list (list (basename
+                                               (strip-store-file-name f)) f))
+                                  '())))))
+                  (list #$@files)))
+
+               (mkdir #$output)
+               (chdir #$output)
+
+               (map (match-lambda       ;XXX: adapted from file-union
+                      ((target source)
+                       ;; Stat the source to abort early if it does not exist.
+                       (stat source)
+                       (mkdir-p (dirname target))
+                       (symlink source target)))
+                    sh-files))))))))
+
+(define files->profile-d-directory
+  (make-files->etc-directory "profile.d"))
+
+(define etc-profile-d-service-type
+  (service-type
+   (name 'etc-profile-d)
+   (extensions (list (service-extension etc-service-type
+                                        files->profile-d-directory)))
+   (compose concatenate)
+   (extend append)
+   (default-value '())
+   (description "A service for populating @file{/etc/profile.d/} with POSIX
+scripts having the @file{.sh} file extension, to be sourced when users
+log in.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 20fc848e5ce..988212b4a7a 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016-2020, 2022, 2024-2025 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2018 Clément Lassieur <clement <at> lassieur.org>
-;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2022, 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2022 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2024 Dariqq <dariqq <at> posteo.net>
 ;;;
@@ -170,6 +170,14 @@ (define* (run-basic-test os command #:optional (name "basic")
 info --version")
                                     marionette)))
 
+          (test-assert "/etc/profile.d is sourced"
+            (zero? (marionette-eval '(system "
+. /etc/profile
+set -e -x
+test -f /etc/profile.d/test_profile_d.sh
+test \"$PROFILE_D_OK\" = yes")
+                                    marionette)))
+
           (test-equal "special files"
             '#$special-files
             (marionette-eval
@@ -563,7 +571,16 @@ (define* (test-basic-os #:optional (kernel linux-libre))
     (let* ((os  (marionette-operating-system
                  (operating-system
                    (inherit %simple-os)
-                   (kernel kernel))
+                   (kernel kernel)
+                   (services (cons (service
+                                    etc-profile-d-service-type
+                                    (list (plain-file
+                                           "test_profile_d.sh"
+                                           "export PROFILE_D_OK=yes\n")
+                                          (plain-file
+                                           "invalid-name"
+                                           "not a POSIX script -- ignore me")))
+                                   %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
            (vm  (virtual-machine os)))
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:02 GMT) Full text and rfc822 format available.

Message #47 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 3/9] gnu: bash: Define the SYS_BASHRC macro.
Date: Tue, 13 May 2025 11:31:42 +0900
This causes Bash to treat /etc/bashrc as a startup file, removing the need to
source /etc/bashrc from ~/.bashrc.

* gnu/packages/bash.scm (bash-fixed): New package, with added SYS_BASHRC
define.
(bash) [replacement]: Use it.
* gnu/system/shadow.scm (%default-bashrc): Do not source /etc/bashrc, now done
implicitly.

Change-Id: I5b0afd7d81653ef19c482e5501efdf7e50ef37c0
---
 gnu/packages/bash.scm | 20 ++++++++++++++++++++
 gnu/system/shadow.scm |  3 ---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index c88f38f5376..bcd78d7d2a9 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2024 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2024 chris <chris <at> bumblehead.com>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -137,6 +138,7 @@ (define-public bash
          (version "5.1"))
     (package
       (name "bash")
+      (replacement bash-fixed)
       (source (origin
                 (method url-fetch)
                 (uri (string-append
@@ -254,6 +256,24 @@ (define-public bash
       (license license:gpl3+)
       (home-page "https://www.gnu.org/software/bash/"))))
 
+(define bash-fixed
+  (package
+    (inherit bash)
+    (arguments
+     (substitute-keyword-arguments (package-arguments bash)
+       ((#:modules modules '%default-gnu-modules)
+        (append '((ice-9 receive)
+                  (srfi srfi-1)
+                  (srfi srfi-26))
+                modules))
+       ((#:configure-flags flags)
+        #~(receive (cppflags flags)
+              (partition (cut string-prefix? "CPPFLAGS" <>)
+                         #$flags)
+            (cons (string-append (first cppflags)
+                                 " -DSYS_BASHRC='\"/etc/bashrc\"'")
+                  flags)))))))
+
 (define-public bash-minimal
   ;; A stripped-down Bash for non-interactive use.
   (package/inherit bash
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index d0f1b6b2b14..50ac102707e 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -164,9 +164,6 @@ (define %default-bashrc
     return
 fi
 
-# Source the system-wide file.
-[ -f /etc/bashrc ] && source /etc/bashrc
-
 alias ls='ls -p --color=auto'
 alias ll='ls -l'
 alias grep='grep --color=auto'
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:03 GMT) Full text and rfc822 format available.

Message #50 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 4/9] system: Source scripts from the /etc/bashrc.d
 directory.
Date: Tue, 13 May 2025 11:31:43 +0900
* gnu/system.scm (operating-system-etc-service): <bashrc>: Source scripts from
the /etc/bashrc.d directory.

Change-Id: I27a20a8eae5d736f32e0df55a68529d9bb613b7a
---
 gnu/system.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 7db0ff5ba5e..0b64927f5ba 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2020 Danny Milosavljevic <dannym <at> scratchpost.org>
 ;;; Copyright © 2020, 2021 Brice Waegeneire <brice <at> waegenei.re>
 ;;; Copyright © 2020 Florian Pelz <pelzflorian <at> pelzflorian.de>
-;;; Copyright © 2020, 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2020, 2022, 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <jannek <at> gnu.org>
 ;;; Copyright © 2020, 2022, 2025 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
@@ -1153,7 +1153,13 @@ (define* (operating-system-etc-service os)
   # completion loader that searches its own completion files as well
   # as those in ~/.guix-profile and /run/current-system/profile.
   source /run/current-system/profile/etc/profile.d/bash_completion.sh
-fi\n")))
+fi
+
+for i in /etc/bashrc.d/*.sh; do
+    [[ -r $i ]] && source \"$i\"
+done
+unset i
+")))
     (service etc-service-type
      `(("os-release" ,os-release)
        ("services" ,(file-append net-base "/etc/services"))
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, gabriel <at> erlikon.ch, ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:03 GMT) Full text and rfc822 format available.

Message #53 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 5/9] services: Add etc-bashrc-d-service-type.
Date: Tue, 13 May 2025 11:31:44 +0900
* gnu/services.scm (files->bashrc-d-directory) New procedure.
(etc-bashrc-d-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.
* gnu/tests/base.scm (test-basic-os): Test it.

Change-Id: Ibbb0f684de7aee296adedbce5b1192786d661af2
---
 doc/guix.texi      | 18 ++++++++++++++++++
 gnu/services.scm   | 14 ++++++++++++++
 gnu/tests/base.scm | 39 ++++++++++++++++++++++++++++++---------
 3 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 2f80b2a0296..559896ff3a1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47572,6 +47572,24 @@ Service Reference
 @end example
 @end defvar
 
+@defvar etc-bashrc-d-service-type
+The type of the @file{/etc/bashrc.d} service.  This service is used to
+create files under @file{/etc/bashrc.d}.  It takes as value a list of
+file-like objects, as can be produced with @code{local-file},
+@code{plain-file}, etc.  Note that provided files whose file names do
+not end with @file{.sh} are @emph{not} added to @file{/etc/profile.d/}
+and are silently dropped.  Package objects can also be provided directly
+to have their @file{etc/bashrc.d/*.sh} prefixed files added.  An example
+usage may look like:
+
+@example
+(use-package-modules gnome)     ;for the `vte' package
+
+(service etc-bashrc-d-service-type
+         (list (file-append vte "/etc/profile.d/vte.sh")))
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index 8584b16ac5c..7083c88c130 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -123,6 +123,7 @@ (define-module (gnu services)
             extra-special-file
             etc-service-type
             etc-profile-d-service-type
+            etc-bashrc-d-service-type
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -988,6 +989,19 @@ (define etc-profile-d-service-type
 scripts having the @file{.sh} file extension, to be sourced when users
 log in.")))
 
+(define files->bashrc-d-directory
+  (make-files->etc-directory "bashrc.d"))
+
+(define etc-bashrc-d-service-type
+  (service-type
+   (inherit etc-profile-d-service-type)
+   (name 'etc-bashrc-d)
+   (extensions (list (service-extension etc-service-type
+                                        files->bashrc-d-directory)))
+   (description "A service for populating @file{/etc/bashrc.d/} with Bash
+scripts having the @file{.sh} file extension, to be sourced by interactive
+Bash shells.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 988212b4a7a..edb7e9112ba 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -178,6 +178,19 @@ (define* (run-basic-test os command #:optional (name "basic")
 test \"$PROFILE_D_OK\" = yes")
                                     marionette)))
 
+          (test-assert "/etc/bashrc.d is sourced"
+            (zero? (marionette-eval
+                    '(system* "bash"
+                              ;; Ensure Bash runs interactively.
+                              "--init-file"
+                              #$(plain-file "test_bashrc_d.sh"
+                                            "\
+. /etc/bashrc
+set -e -x
+test -f /etc/bashrc.d/test_bashrc_d.sh
+test \"$BASHRC_D_OK\" = yes"))
+                    marionette)))
+
           (test-equal "special files"
             '#$special-files
             (marionette-eval
@@ -572,15 +585,23 @@ (define* (test-basic-os #:optional (kernel linux-libre))
                  (operating-system
                    (inherit %simple-os)
                    (kernel kernel)
-                   (services (cons (service
-                                    etc-profile-d-service-type
-                                    (list (plain-file
-                                           "test_profile_d.sh"
-                                           "export PROFILE_D_OK=yes\n")
-                                          (plain-file
-                                           "invalid-name"
-                                           "not a POSIX script -- ignore me")))
-                                   %base-services)))
+                   (services (cons* (service
+                                     etc-profile-d-service-type
+                                     (list (plain-file
+                                            "test_profile_d.sh"
+                                            "export PROFILE_D_OK=yes\n")
+                                           (plain-file
+                                            "invalid-name"
+                                            "not a POSIX script -- ignore me")))
+                                    (service
+                                     etc-bashrc-d-service-type
+                                     (list (plain-file
+                                            "test_bashrc_d.sh"
+                                            "export BASHRC_D_OK=yes\n")
+                                           (plain-file
+                                            "invalid-name"
+                                            "not a Bash script -- ignore me")))
+                                    %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
            (vm  (virtual-machine os)))
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, gabriel <at> erlikon.ch, ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:04 GMT) Full text and rfc822 format available.

Message #56 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 6/9] system: Migrate sourcing bash_completion.sh to
 etc-bashrc-d-service-type.
Date: Tue, 13 May 2025 11:31:45 +0900
* gnu/system.scm (operating-system-etc-service): Remove block sourcing
bash_completion.sh.
(%base-packages-interactive): Delete bash-completion.
* gnu/services.scm (%default-etc-bashrc-d-files): New variable, which includes
the bash_completion.sh file.
(etc-bashrc-d-service-type): Use it.
* doc/guix.texi (Service Reference): Update documentation.

Change-Id: I2223a5f96f5d761148badc6be29e1c5c80465a1d
---
 doc/guix.texi    | 11 +++++++----
 gnu/services.scm |  8 +++++++-
 gnu/system.scm   | 10 ----------
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 559896ff3a1..28ce18688e7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47578,15 +47578,18 @@ Service Reference
 file-like objects, as can be produced with @code{local-file},
 @code{plain-file}, etc.  Note that provided files whose file names do
 not end with @file{.sh} are @emph{not} added to @file{/etc/profile.d/}
-and are silently dropped.  Package objects can also be provided directly
-to have their @file{etc/bashrc.d/*.sh} prefixed files added.  An example
-usage may look like:
+and are silently dropped.  The default value is made available via the
+@var{%default-etc-bashrc-d-files} variable for users to extended.
+Package objects can also be provided directly to have their
+@file{etc/bashrc.d/*.sh} prefixed files added.  An example usage may
+look like:
 
 @example
 (use-package-modules gnome)     ;for the `vte' package
 
 (service etc-bashrc-d-service-type
-         (list (file-append vte "/etc/profile.d/vte.sh")))
+         (append (list (file-append vte "/etc/profile.d/vte.sh"))
+                 %default-etc-bashrc-d-files))
 @end example
 @end defvar
 
diff --git a/gnu/services.scm b/gnu/services.scm
index 7083c88c130..5dbda176b80 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -124,6 +124,7 @@ (define-module (gnu services)
             etc-service-type
             etc-profile-d-service-type
             etc-bashrc-d-service-type
+            %default-etc-bashrc-d-files
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -992,6 +993,10 @@ (define etc-profile-d-service-type
 (define files->bashrc-d-directory
   (make-files->etc-directory "bashrc.d"))
 
+(define %default-etc-bashrc-d-files
+  (list (file-append bash-completion
+                     "/etc/profile.d/bash_completion.sh")))
+
 (define etc-bashrc-d-service-type
   (service-type
    (inherit etc-profile-d-service-type)
@@ -1000,7 +1005,8 @@ (define etc-bashrc-d-service-type
                                         files->bashrc-d-directory)))
    (description "A service for populating @file{/etc/bashrc.d/} with Bash
 scripts having the @file{.sh} file extension, to be sourced by interactive
-Bash shells.")))
+Bash shells.")
+   (default-value %default-etc-bashrc-d-files)))
 
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
diff --git a/gnu/system.scm b/gnu/system.scm
index 0b64927f5ba..50f739c17c7 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -960,7 +960,6 @@ (define %base-packages-interactive
         nvi
         man-db
         info-reader                     ;the standalone Info reader (no Perl)
-        bash-completion
         kbd
         ;; The 'sudo' command is already in %SETUID-PROGRAMS, but we also
         ;; want the other commands and the man pages (notably because
@@ -1146,15 +1145,6 @@ (define* (operating-system-etc-service os)
 # Provide a default prompt.  The user's ~/.bashrc can override it.
 PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
 
-# The 'bash-completion' package.
-if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ]
-then
-  # Bash-completion sources ~/.bash_completion.  It installs a dynamic
-  # completion loader that searches its own completion files as well
-  # as those in ~/.guix-profile and /run/current-system/profile.
-  source /run/current-system/profile/etc/profile.d/bash_completion.sh
-fi
-
 for i in /etc/bashrc.d/*.sh; do
     [[ -r $i ]] && source \"$i\"
 done
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, andrew <at> trop.in, gabriel <at> erlikon.ch, hako <at> ultrarare.space, janneke <at> gnu.org, ludo <at> gnu.org, tanguy <at> bioneland.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:04 GMT) Full text and rfc822 format available.

Message #59 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 7/9] system: Factorize bashrc default configuration.
Date: Tue, 13 May 2025 11:31:46 +0900
This factorizes out the remaining bashrc bits from /etc/skel/.bashrc to a the
template used for both /etc/bashrc on Guix System and ~/.bashrc for
home-bash-service-type.

Rationale: The use of /etc/skel introduce state: the file is only copied
originally when the user account is created, and never (automatically)
refreshed again.

* gnu/system.scm (operating-system-etc-service):
<profile>: Guard against souring /etc/bashrc in non-interactive, SSH case.
<bashrc>: Use %default-bashrc, having migrated the remaining definitions to...
* gnu/system/shadow.scm (%default-bashrc): ... here.  Factorize aliases to...
* gnu/services.scm (%default-bash-aliases): ... here.
(%default-bashrc-d-aliases): New variable.
(%default-etc-bashrc-d-files): Include it in the default configuration.
* gnu/services/base.scm (%base-services): Register etc-bashrc-d-service-type.
* gnu/home/services/shells.scm (add-bash-configuration): Do not set PS1, now
part of %default-bashrc.
(home-bash-configuration) [guix-defaults?]: Update doc.
[aliases]: Set %default-bash-aliases as the default value.  Update doc.
* doc/guix.texi (Shells Home Services): Update documentation.
(Service Reference): Update example.

Change-Id: I340c614983a78fd20a9c4a9705e7fc542ae9b513
---
 doc/guix.texi                | 19 +++++++++++--------
 gnu/home/services/shells.scm | 14 +++++++-------
 gnu/services.scm             | 23 +++++++++++++++++++++--
 gnu/services/base.scm        |  5 ++++-
 gnu/system.scm               | 24 +++++++-----------------
 gnu/system/shadow.scm        | 18 ++++++++++--------
 gnu/tests/base.scm           | 17 ++++++++++-------
 7 files changed, 70 insertions(+), 50 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 28ce18688e7..655eac6168d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47581,15 +47581,15 @@ Service Reference
 and are silently dropped.  The default value is made available via the
 @var{%default-etc-bashrc-d-files} variable for users to extended.
 Package objects can also be provided directly to have their
-@file{etc/bashrc.d/*.sh} prefixed files added.  An example usage may
-look like:
+@file{etc/bashrc.d/*.sh} prefixed files added.  Since the service is
+part @code{%base-services}, it can be extended via @code{simple-service}
+like so:
 
 @example
 (use-package-modules gnome)     ;for the `vte' package
 
-(service etc-bashrc-d-service-type
-         (append (list (file-append vte "/etc/profile.d/vte.sh"))
-                 %default-etc-bashrc-d-files))
+(simple-service 'vte-integration etc-bashrc-d-service-type
+                (list (file-append vte "/etc/profile.d/vte.sh")))
 @end example
 @end defvar
 
@@ -49215,8 +49215,11 @@ Shells Home Services
 The Bash package to use.
 
 @item @code{guix-defaults?} (default: @code{#t}) (type: boolean)
-Add sane defaults like reading @file{/etc/bashrc} and coloring the output of
-@command{ls} to the top of the @file{.bashrc} file.
+Add sane defaults like setting @env{PS1}, @env{SHELL}, and ensuring
+@file{/etc/profile} is sourced for non-interactive SSH shells.  If you
+use Guix System, is it safe to set this to @code{#f}, as in this case
+this is already taken care of by the globally installed
+@file{/etc/bashrc}.
 
 @item @code{environment-variables} (default: @code{'()}) (type: alist)
 Association list of environment variables to set for the Bash session.  The
@@ -49224,7 +49227,7 @@ Shells Home Services
 here (@pxref{Essential Home Services}).  The contents of this field will be
 added after the contents of the @code{bash-profile} field.
 
-@item @code{aliases} (default: @code{'()}) (type: alist)
+@item @code{aliases} (default: @code{%default-bash-aliases}) (type: alist)
 Association list of aliases to set for the Bash session.  The aliases
 will be defined after the contents of the @code{bashrc} field has been
 put in the @file{.bashrc} file.  The alias will automatically be quoted,
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index bab5730c3d6..969a3eb8dcf 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -20,6 +20,7 @@
 
 (define-module (gnu home services shells)
   #:use-module (gnu services configuration)
+  #:use-module ((gnu services) #:select (%default-bash-aliases))
   #:autoload   (gnu system shadow) (%default-bashrc %default-zprofile)
   #:use-module (gnu home services utils)
   #:use-module (gnu home services)
@@ -333,9 +334,12 @@ (define-configuration home-bash-configuration
    (package bash)
    "The Bash package to use.")
   (guix-defaults?
+   ;; TODO: Set to #f when the target system is determined to be Guix System.
    (boolean #t)
-   "Add sane defaults like reading @file{/etc/bashrc} and coloring the output of
-@command{ls} to the top of the @file{.bashrc} file.")
+   "Add sane defaults like setting @env{PS1}, @env{SHELL}, and ensuring
+@file{/etc/profile} is sourced for non-interactive SSH shells.  If you use
+Guix System, is it safe to set this to @code{#f}, as in this case this is
+already taken care of by the globally installed @file{/etc/bashrc}.")
   (environment-variables
    (alist '())
    "Association list of environment variables to set for the Bash session.  The
@@ -344,7 +348,7 @@ (define-configuration home-bash-configuration
 added after the contents of the @code{bash-profile} field."
    (serializer serialize-posix-env-vars))
   (aliases
-   (alist '())
+   (alist %default-bash-aliases)
    "Association list of aliases to set for the Bash session.  The aliases will be
 defined after the contents of the @code{bashrc} field has been put in the
 @file{.bashrc} file.  The alias will automatically be quoted, so something line
@@ -423,10 +427,6 @@ (define (add-bash-configuration config)
               'bashrc
               (if (home-bash-configuration-guix-defaults? config)
                   (list (plain-file-content %default-bashrc) "\n"
-                        ;; The host distro might provide a bad 'PS1'
-                        ;; default--e.g., not taking $GUIX_ENVIRONMENT into
-                        ;; account.  Provide a good default here when asked.
-                        "PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '\n"
                         (serialize-field 'aliases))
                   (list (serialize-field 'aliases))))
              (file-if-not-empty 'bash-logout)))))
diff --git a/gnu/services.scm b/gnu/services.scm
index 5dbda176b80..159d357c3e7 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -125,6 +125,7 @@ (define-module (gnu services)
             etc-profile-d-service-type
             etc-bashrc-d-service-type
             %default-etc-bashrc-d-files
+            %default-bash-aliases
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -993,9 +994,27 @@ (define etc-profile-d-service-type
 (define files->bashrc-d-directory
   (make-files->etc-directory "bashrc.d"))
 
+;;; Use an alist to be compatible with <home-bash-configuration>.
+(define %default-bash-aliases
+  '(("ls" . "ls -p --color=auto")
+    ("ll" . "ls -l")
+    ("grep" . "grep --color=auto")
+    ("ip" . "ip -color=auto")))
+
+;;; ... but avoid the full blown bash-serialize-aliases, which depends on
+;;; other 'guix home' definitions such as `shell-double-quote'.
+(define %default-bashrc-d-aliases
+  (plain-file "aliases.sh"
+              (string-join
+               (map (match-lambda
+                      ((alias . value)
+                       (format #f "~a=~s~%" alias value)))
+                    %default-bash-aliases)
+               "")))
+
 (define %default-etc-bashrc-d-files
-  (list (file-append bash-completion
-                     "/etc/profile.d/bash_completion.sh")))
+  (list (file-append bash-completion "/etc/profile.d/bash_completion.sh")
+        %default-bashrc-d-aliases))
 
 (define etc-bashrc-d-service-type
   (service-type
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index dfb96b1f0cc..adf456dc99e 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -4135,7 +4135,10 @@ (define %base-services
         (service mingetty-service-type (mingetty-configuration
                                          (tty "tty5")))
         (service mingetty-service-type (mingetty-configuration
-                                         (tty "tty6")))
+                                        (tty "tty6")))
+
+        ;; Extra Bash configuration including Bash completion and aliases.
+        (service etc-bashrc-d-service-type)
 
         (service static-networking-service-type
                  (list %loopback-static-networking))
diff --git a/gnu/system.scm b/gnu/system.scm
index 50f739c17c7..0b251bd3a08 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1132,23 +1132,13 @@ (define* (operating-system-etc-service os)
 done
 unset i
 
-if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
-then
-  # Load Bash-specific initialization code.
-  . /etc/bashrc
+if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]; then
+  # Load Bash-specific initialization code, taking care to not source
+  # /etc/bashrc when invoked from a non-interactive SSH shell,
+  # to avoid recursion (/etc/bashrc also sources /etc/profile
+  # in the non-login, non-interactive SSH case).
+  [[ $- != *i* && -n $SSH_CLIENT ]] || source /etc/bashrc
 fi
-"))
-
-        (bashrc    (plain-file "bashrc" "\
-# Bash-specific initialization.
-
-# Provide a default prompt.  The user's ~/.bashrc can override it.
-PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
-
-for i in /etc/bashrc.d/*.sh; do
-    [[ -r $i ]] && source \"$i\"
-done
-unset i
 ")))
     (service etc-service-type
      `(("os-release" ,os-release)
@@ -1159,7 +1149,7 @@ (define* (operating-system-etc-service os)
        ("issue" ,issue)
        ,@(if nsswitch `(("nsswitch.conf" ,nsswitch)) '())
        ("profile" ,profile)
-       ("bashrc" ,bashrc)
+       ("bashrc" ,%default-bashrc)
        ;; Write the operating-system-host-name to /etc/hostname to prevent
        ;; NetworkManager from changing the system's hostname when connecting
        ;; to certain networks.  Some discussion at
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 50ac102707e..03af193f36f 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -146,8 +146,11 @@ (define %base-user-accounts
 
 (define %default-bashrc
   (plain-file "bashrc" "\
-# Bash initialization for interactive non-login shells and
-# for remote shells (info \"(bash) Bash Startup Files\").
+# Bash-specific initialization, including for non-login and remote
+# shells (info \"(bash) Bash Startup Files\").
+
+# Provide a default prompt.
+PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
 
 # Export 'SHELL' to child processes.  Programs such as 'screen'
 # honor it and otherwise use /bin/sh.
@@ -164,10 +167,11 @@ (define %default-bashrc
     return
 fi
 
-alias ls='ls -p --color=auto'
-alias ll='ls -l'
-alias grep='grep --color=auto'
-alias ip='ip -color=auto'\n"))
+for i in /etc/bashrc.d/*.sh; do
+    [[ -r $i ]] && source \"$i\"
+done
+unset i
+"))
 
 (define %default-bash-profile
   (plain-file "bash_profile" "\
@@ -288,12 +292,10 @@ (define (default-skeletons)
 'useradd' in the home directory of newly created user accounts."
 
   (let ((profile   %default-bash-profile)
-        (bashrc    %default-bashrc)
         (zprofile  %default-zprofile)
         (xdefaults %default-xdefaults)
         (gdbinit   %default-gdbinit))
     `((".bash_profile" ,profile)
-      (".bashrc" ,bashrc)
       ;; Zsh sources ~/.zprofile before ~/.zshrc, and it sources ~/.zlogin
       ;; after ~/.zshrc.  To avoid interfering with any customizations a user
       ;; may have made in their ~/.zshrc, put this in .zprofile, not .zlogin.
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index edb7e9112ba..85e5b954b90 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -187,6 +187,8 @@ (define* (run-basic-test os command #:optional (name "basic")
                                             "\
 . /etc/bashrc
 set -e -x
+test -f /etc/bashrc.d/bash_completion.sh
+test -f /etc/bashrc.d/aliases.sh
 test -f /etc/bashrc.d/test_bashrc_d.sh
 test \"$BASHRC_D_OK\" = yes"))
                     marionette)))
@@ -593,14 +595,15 @@ (define* (test-basic-os #:optional (kernel linux-libre))
                                            (plain-file
                                             "invalid-name"
                                             "not a POSIX script -- ignore me")))
-                                    (service
+                                    (simple-service
+                                     'extra-bashrc-d-files
                                      etc-bashrc-d-service-type
-                                     (list (plain-file
-                                            "test_bashrc_d.sh"
-                                            "export BASHRC_D_OK=yes\n")
-                                           (plain-file
-                                            "invalid-name"
-                                            "not a Bash script -- ignore me")))
+                                     (list  (plain-file
+                                             "test_bashrc_d.sh"
+                                             "export BASHRC_D_OK=yes\n")
+                                            (plain-file
+                                             "invalid-name"
+                                             "not a Bash script -- ignore me")))
                                     %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, gabriel <at> erlikon.ch, ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:05 GMT) Full text and rfc822 format available.

Message #62 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 8/9] services: Add vte-integration-service-type.
Date: Tue, 13 May 2025 11:31:47 +0900
* gnu/services.scm (vte-integration-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.

Change-Id: I7e4bc1b913b50a5a061894f9ddef27f1877b62a2
---
 doc/guix.texi    | 15 +++++++++++++++
 gnu/services.scm | 15 +++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 655eac6168d..591d42f82f5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47593,6 +47593,21 @@ Service Reference
 @end example
 @end defvar
 
+@defvar vte-integration-service-type
+This services adds the @file{/etc/bashrc.d/vte.sh} to your system, which
+improves the Bash and Zsh experience when using VTE-powered terminal
+emulators.  This causes for example the current directory to be
+displayed in the terminal emulator's tab title, and the current
+directory to be preserved when creating a new tab, among other features.
+The value of the service is the @code{vte} package to use.
+
+@example
+(use-package-modules gnome)     ;for the `vte' package
+
+(service vte-integration-service-type vte)
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index 159d357c3e7..ce15a39d063 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -47,6 +47,7 @@ (define-module (gnu services)
   #:use-module (guix deprecation)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages hurd)
   #:use-module (gnu packages linux)
   #:use-module (gnu system privilege)
@@ -138,6 +139,7 @@ (define-module (gnu services)
             linux-builder-configuration-kernel
             linux-builder-configuration-modules
             linux-loadable-module-service-type
+            vte-integration-service-type
 
             %boot-service
             %activation-service
@@ -1027,6 +1029,19 @@ (define etc-bashrc-d-service-type
 Bash shells.")
    (default-value %default-etc-bashrc-d-files)))
 
+(define vte-integration-service-type
+  (service-type
+   (name 'vte-integration)
+   (extensions
+    (list (service-extension etc-bashrc-d-service-type
+                             (lambda (vte)
+                               (list (file-append
+                                      vte "/etc/profile.d/vte.sh"))))))
+   (default-value vte)                  ;the vte package to use
+   (description "A service for adding the @file{/etc/bashrc.d/vte.sh} script
+to your system, which improves the Bash and Zsh experience when using
+VTE-powered terminal emulators.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, liliana.prikler <at> gmail.com, noelopez <at> free.fr, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 02:33:05 GMT) Full text and rfc822 format available.

Message #65 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 9/9] services: Add vte-integration-service-type to
 %desktop-services.
Date: Tue, 13 May 2025 11:31:48 +0900
* gnu/services/desktop.scm (desktop-services-for-system):

Fixes: <https://issues.guix.gnu.org/72172>
Change-Id: Ib29468468e327801a4e95361610159de61f7e8d6
---
 gnu/services/desktop.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 12560a6249d..38ff2187356 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -2463,6 +2463,10 @@ (define* (desktop-services-for-system #:optional
          ;; to avoid GDM stale cache and permission issues.
          gdm-file-system-service
 
+         ;; Provides a nicer experience for VTE-using terminal emulators such
+         ;; as GNOME Console, Xfce Terminal, etc.
+         (service vte-integration-service-type)
+
          ;; The global fontconfig cache directory can sometimes contain
          ;; stale entries, possibly referencing fonts that have been GC'd,
          ;; so mount it read-only.
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 13 May 2025 12:16:01 GMT) Full text and rfc822 format available.

Message #68 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: "Luis Guilherme Coelho" <lgcoelho <at> disroot.org>
To: "Maxim Cournoyer" <maxim.cournoyer <at> gmail.com>, <78308 <at> debbugs.gnu.org>
Cc: Rutherther <rutherther <at> ditigal.xyz>, Gabriel Wicki <gabriel <at> erlikon.ch>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [bug#78308] [PATCH v2 2/9] services: Add
 etc-profile-d-service-type.
Date: Tue, 13 May 2025 09:15:16 -0300
> +@example
> +(service etc-profile-d-service-type
> +         (list (plain-file "youppi.sh" HOW_IMPORTANT=very")))
> +@end example
> +@end defvar
I'm not really doing a review or something, but thought it would be
pertinent do say. There's a missing quote before HOW_IMPORTANT=very.

Best regards,
Luis Guilherme Coelho




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Wed, 14 May 2025 13:28:03 GMT) Full text and rfc822 format available.

Message #71 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: "Luis Guilherme Coelho" <lgcoelho <at> disroot.org>
Cc: Gabriel Wicki <gabriel <at> erlikon.ch>, Rutherther <rutherther <at> ditigal.xyz>,
 78308 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [bug#78308] [PATCH v2 2/9] services: Add
 etc-profile-d-service-type.
Date: Wed, 14 May 2025 22:26:28 +0900
Hi Luis,

"Luis Guilherme Coelho" <lgcoelho <at> disroot.org> writes:

>> +@example
>> +(service etc-profile-d-service-type
>> +         (list (plain-file "youppi.sh" HOW_IMPORTANT=very")))
>> +@end example
>> +@end defvar
> I'm not really doing a review or something, but thought it would be
> pertinent do say. There's a missing quote before HOW_IMPORTANT=very.

Thanks.  Maybe I'll get it right in v3.  I probably should have just
copied a snippet used in the system tests to ensure it's been tested and
works ;-).

I also forgot the news entry, which I'll tackle in v3 as well.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Sun, 18 May 2025 13:55:02 GMT) Full text and rfc822 format available.

Message #74 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Rutherther <rutherther <at> ditigal.xyz>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 78308 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/9] VTE integration support / Shell startup files refactor
Date: Sun, 18 May 2025 15:54:19 +0200
Hi,

I've tried playing with this a bit.

I would like to point out that maybe it would be better to add extension
of the service to the manual rather than creation of the service. Most
users will be using profile-d service as they are using
desktop-services. So instead of (service-type etc-profile-d-service-type
...) something like (simple-service 'my-simple-profile-file
etc-profile-d-service-type ...).

As for the bashrc and profile d, it seems working right and I don't have
any more comments apart from documentation changes.

As for vte, I am not really sure what the integration does and have
difficulty searching for the features. All I can get is that it
integrates with terminal and makes it better, but not in what way. As I
am quite a minimal, using dwl and foot, I have no idea how does Gnome
and Gnome Terminal integrate nor how to check if it does the right thing
with this addition.

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

>
> A full world rebuild seems very expensive for this change alone.  The
> only thing this switch does is cause Bash to source /etc/bashrc when it
> also sources also ~/.bashrc.  Since there is no /etc/bashrc in the build
> container, we shoud be good in terms of not breaking anything build wise.
>

I got a bit confused I think. The thing is that I was thinking about
other packages using bash. But as bash is not a library, but an
executable, all should really be fine.

>
>> I don't think removing the PS1 from guix home bashrc is appropriate. I think
>> the PS1 is mostly for foreign distros, not for Guix System, it's even
>> mentioned in the comment that it's for distros that don't provide a good PS1.
>
> It's not removed, but moved, as the change log says for the "system:
> Factorize bashrc default configuration." commit:
>
> --8<---------------cut here---------------start------------->8---
> * gnu/home/services/shells.scm (add-bash-configuration): Do not set PS1, now
> part of %default-bashrc.
> --8<---------------cut here---------------end--------------->8---
>
> Guix home uses the %default-bashrc, so it's covered.  It's something
> I've tried paying attention to, it's good you saw that too.

Ah, I've missed that.

WDYT, thanks
Rutherther




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:25:02 GMT) Full text and rfc822 format available.

Message #77 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Rutherther <rutherther <at> ditigal.xyz>
Cc: 78308 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/9] VTE integration support / Shell startup files refactor
Date: Mon, 19 May 2025 09:24:28 +0900
Hi Rutherther,

Rutherther <rutherther <at> ditigal.xyz> writes:

> Hi,
>
> I've tried playing with this a bit.
>
> I would like to point out that maybe it would be better to add extension
> of the service to the manual rather than creation of the service. Most
> users will be using profile-d service as they are using
> desktop-services. So instead of (service-type etc-profile-d-service-type
> ...) something like (simple-service 'my-simple-profile-file
> etc-profile-d-service-type ...).

Currently only etc-bashrc-d-service-type is used in %base-services, so
we can't extend etc-profile-d-service-type, since it doesn't exist in
the base templates.

> As for the bashrc and profile d, it seems working right and I don't have
> any more comments apart from documentation changes.

I'm pushing a v3 with the news entry you had suggested in a minute.

> As for vte, I am not really sure what the integration does and have
> difficulty searching for the features. All I can get is that it
> integrates with terminal and makes it better, but not in what way. As I
> am quite a minimal, using dwl and foot, I have no idea how does Gnome
> and Gnome Terminal integrate nor how to check if it does the right thing
> with this addition.

The main thing for me is having a consistent title for the tab in gnome
console or gnome terminal applications.  It also preserves the current
working directory when opening new tabs, and offers other features.  I
guess the best way to know what other features it provides is by reading
the vte.sh script or the source of libvte.

Thanks for reviewing/testing!

-- 
Thanks,
Maxim




Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:30:03 GMT) Full text and rfc822 format available.

Message #80 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 01/10] system: Source scripts from the /etc/profile.d
 directory.
Date: Mon, 19 May 2025 09:28:59 +0900
This is useful since our /etc/profile file is otherwise not easily
extendable.

* gnu/system.scm (operating-system-etc-service): Source all '.sh' ending
files found under the /etc/profile.d directory.

Change-Id: Ia6d777195241f69219f00fbd5975e3e6b7c265fb
---
 gnu/system.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/system.scm b/gnu/system.scm
index 2beca4b6d08..7db0ff5ba5e 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1122,6 +1122,17 @@ (define* (operating-system-etc-service os)
 # Allow GStreamer-based applications to find plugins.
 export GST_PLUGIN_PATH=\"$HOME/.guix-profile/lib/gstreamer-1.0\"
 
+for i in /etc/profile.d/*.sh; do
+    if [ -r \"$i\" ]; then
+        if [ \"${-#*i}\" != \"$-\" ]; then
+            . \"$i\"
+        else
+            . \"$i\" >/dev/null
+        fi
+    fi
+done
+unset i
+
 if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
 then
   # Load Bash-specific initialization code.

base-commit: 6b5fc4812981f2cadffcc5d39e48cd8e02ee73af
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:30:04 GMT) Full text and rfc822 format available.

Message #83 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 03/10] gnu: bash: Define the SYS_BASHRC macro.
Date: Mon, 19 May 2025 09:29:01 +0900
This causes Bash to treat /etc/bashrc as a startup file, removing the need to
source /etc/bashrc from ~/.bashrc.

* gnu/packages/bash.scm (bash-fixed): New package, with added SYS_BASHRC
define.
(bash) [replacement]: Use it.
* gnu/system/shadow.scm (%default-bashrc): Do not source /etc/bashrc, now done
implicitly.

Change-Id: I5b0afd7d81653ef19c482e5501efdf7e50ef37c0
---
 gnu/packages/bash.scm | 20 ++++++++++++++++++++
 gnu/system/shadow.scm |  3 ---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index c88f38f5376..bcd78d7d2a9 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2024 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2024 chris <chris <at> bumblehead.com>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -137,6 +138,7 @@ (define-public bash
          (version "5.1"))
     (package
       (name "bash")
+      (replacement bash-fixed)
       (source (origin
                 (method url-fetch)
                 (uri (string-append
@@ -254,6 +256,24 @@ (define-public bash
       (license license:gpl3+)
       (home-page "https://www.gnu.org/software/bash/"))))
 
+(define bash-fixed
+  (package
+    (inherit bash)
+    (arguments
+     (substitute-keyword-arguments (package-arguments bash)
+       ((#:modules modules '%default-gnu-modules)
+        (append '((ice-9 receive)
+                  (srfi srfi-1)
+                  (srfi srfi-26))
+                modules))
+       ((#:configure-flags flags)
+        #~(receive (cppflags flags)
+              (partition (cut string-prefix? "CPPFLAGS" <>)
+                         #$flags)
+            (cons (string-append (first cppflags)
+                                 " -DSYS_BASHRC='\"/etc/bashrc\"'")
+                  flags)))))))
+
 (define-public bash-minimal
   ;; A stripped-down Bash for non-interactive use.
   (package/inherit bash
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 7258a57dc6a..b9a5a6134bc 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -165,9 +165,6 @@ (define %default-bashrc
     return
 fi
 
-# Source the system-wide file.
-[ -f /etc/bashrc ] && source /etc/bashrc
-
 alias ls='ls -p --color=auto'
 alias ll='ls -l'
 alias grep='grep --color=auto'
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, gabriel <at> erlikon.ch, ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:30:05 GMT) Full text and rfc822 format available.

Message #86 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 02/10] services: Add etc-profile-d-service-type.
Date: Mon, 19 May 2025 09:29:00 +0900
* gnu/services.scm (make-files->etc-directory)
(files->profile-d-entries): New procedures.
(etc-profile-d-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.
* gnu/tests/base.scm (run-basic-test): Test it.

Change-Id: I45dde43a1b9603c3384b933ebd1d6e45dba146b9
---
 doc/guix.texi      | 16 ++++++++++++
 gnu/services.scm   | 62 ++++++++++++++++++++++++++++++++++++++++++++++
 gnu/tests/base.scm | 19 +++++++++++++-
 3 files changed, 96 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 8e73685a216..b236a358a1f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47629,6 +47629,22 @@ Service Reference
 pointing to the given file.
 @end defvar
 
+@defvar etc-profile-d-service-type
+The type of the @file{/etc/profile.d} service.  This service is used to
+create files under @file{/etc/profile.d}.  It takes as value a list of
+file-like objects, as can be produced with @code{local-file},
+@code{plain-file}, etc.  Note that provided files whose file names do
+not end with @file{.sh} are @emph{not} added to @file{/etc/profile.d/}
+and are silently dropped.  Package objects can also be provided directly
+to have their @file{etc/profile.d/*.sh} prefixed files added.  A simple
+usage may look like:
+
+@example
+(service etc-profile-d-service-type
+         (list (plain-file "youppi.sh" "HOW_IMPORTANT=very")))
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index af054339fd9..8584b16ac5c 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2023 Brian Cully <bjc <at> spork.org>
 ;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu services)
+  #:use-module (guix derivations)
   #:use-module (guix gexp)
   #:use-module (guix monads)
   #:use-module (guix store)
@@ -120,6 +122,7 @@ (define-module (gnu services)
             special-files-service-type
             extra-special-file
             etc-service-type
+            etc-profile-d-service-type
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -926,6 +929,65 @@ (define-deprecated (etc-service files)
 FILES must be a list of name/file-like object pairs."
   (service etc-service-type files))
 
+(define (make-files->etc-directory name)
+  "Return a procedure that accept a list of FILES and compute a directory named NAME.
+The returned procedure FILES argument can be packages containing
+@file{etc/@var{name}.d/@var{x}.sh} scripts or single file-like objects of the
+@file{.sh} file extension.  The constructed procedure returns a list of
+two-elements list suitable for extending `etc-service-type'."
+  (lambda (files)
+    `((,name
+       ,(computed-file name
+         ;; This is specialized variant of `file-union'.
+         (with-imported-modules '((guix build utils))
+           #~(begin
+               (use-modules (guix build utils)
+                            (ice-9 ftw)
+                            (ice-9 match)
+                            (srfi srfi-1)
+                            (srfi srfi-26))
+
+               (define sh-files
+                 (append-map
+                  (lambda (f)
+                    (let* ((dir (format #f "~a/etc/~a" f #$name)))
+                      `(,@(if (file-exists? dir)
+                              (map (lambda (x)
+                                     (list x (string-append dir "/" x)))
+                                   (scandir dir
+                                            (cut string-suffix? ".sh" <>)))
+                              (if (string-suffix? ".sh" f)
+                                  (list (list (basename
+                                               (strip-store-file-name f)) f))
+                                  '())))))
+                  (list #$@files)))
+
+               (mkdir #$output)
+               (chdir #$output)
+
+               (map (match-lambda       ;XXX: adapted from file-union
+                      ((target source)
+                       ;; Stat the source to abort early if it does not exist.
+                       (stat source)
+                       (mkdir-p (dirname target))
+                       (symlink source target)))
+                    sh-files))))))))
+
+(define files->profile-d-directory
+  (make-files->etc-directory "profile.d"))
+
+(define etc-profile-d-service-type
+  (service-type
+   (name 'etc-profile-d)
+   (extensions (list (service-extension etc-service-type
+                                        files->profile-d-directory)))
+   (compose concatenate)
+   (extend append)
+   (default-value '())
+   (description "A service for populating @file{/etc/profile.d/} with POSIX
+scripts having the @file{.sh} file extension, to be sourced when users
+log in.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index f28c610ccb2..09fc91383df 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -170,6 +170,14 @@ (define* (run-basic-test os command #:optional (name "basic")
 info --version")
                                     marionette)))
 
+          (test-assert "/etc/profile.d is sourced"
+            (zero? (marionette-eval '(system "
+. /etc/profile
+set -e -x
+test -f /etc/profile.d/test_profile_d.sh
+test \"$PROFILE_D_OK\" = yes")
+                                    marionette)))
+
           (test-equal "special files"
             '#$special-files
             (marionette-eval
@@ -576,7 +584,16 @@ (define* (test-basic-os #:optional (kernel linux-libre))
     (let* ((os  (marionette-operating-system
                  (operating-system
                    (inherit %simple-os)
-                   (kernel kernel))
+                   (kernel kernel)
+                   (services (cons (service
+                                    etc-profile-d-service-type
+                                    (list (plain-file
+                                           "test_profile_d.sh"
+                                           "export PROFILE_D_OK=yes\n")
+                                          (plain-file
+                                           "invalid-name"
+                                           "not a POSIX script -- ignore me")))
+                                   %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
            (vm  (virtual-machine os)))
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:30:06 GMT) Full text and rfc822 format available.

Message #89 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 04/10] system: Source scripts from the /etc/bashrc.d
 directory.
Date: Mon, 19 May 2025 09:29:02 +0900
* gnu/system.scm (operating-system-etc-service): <bashrc>: Source scripts from
the /etc/bashrc.d directory.

Change-Id: I27a20a8eae5d736f32e0df55a68529d9bb613b7a
---
 gnu/system.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 7db0ff5ba5e..0b64927f5ba 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2020 Danny Milosavljevic <dannym <at> scratchpost.org>
 ;;; Copyright © 2020, 2021 Brice Waegeneire <brice <at> waegenei.re>
 ;;; Copyright © 2020 Florian Pelz <pelzflorian <at> pelzflorian.de>
-;;; Copyright © 2020, 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2020, 2022, 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <jannek <at> gnu.org>
 ;;; Copyright © 2020, 2022, 2025 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
@@ -1153,7 +1153,13 @@ (define* (operating-system-etc-service os)
   # completion loader that searches its own completion files as well
   # as those in ~/.guix-profile and /run/current-system/profile.
   source /run/current-system/profile/etc/profile.d/bash_completion.sh
-fi\n")))
+fi
+
+for i in /etc/bashrc.d/*.sh; do
+    [[ -r $i ]] && source \"$i\"
+done
+unset i
+")))
     (service etc-service-type
      `(("os-release" ,os-release)
        ("services" ,(file-append net-base "/etc/services"))
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, gabriel <at> erlikon.ch, ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:30:07 GMT) Full text and rfc822 format available.

Message #92 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 05/10] services: Add etc-bashrc-d-service-type.
Date: Mon, 19 May 2025 09:29:03 +0900
* gnu/services.scm (files->bashrc-d-directory) New procedure.
(etc-bashrc-d-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.
* gnu/tests/base.scm (test-basic-os): Test it.

Change-Id: Ibbb0f684de7aee296adedbce5b1192786d661af2
---
 doc/guix.texi      | 18 ++++++++++++++++++
 gnu/services.scm   | 14 ++++++++++++++
 gnu/tests/base.scm | 39 ++++++++++++++++++++++++++++++---------
 3 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index b236a358a1f..927e9243bfb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47645,6 +47645,24 @@ Service Reference
 @end example
 @end defvar
 
+@defvar etc-bashrc-d-service-type
+The type of the @file{/etc/bashrc.d} service.  This service is used to
+create files under @file{/etc/bashrc.d}.  It takes as value a list of
+file-like objects, as can be produced with @code{local-file},
+@code{plain-file}, etc.  Note that provided files whose file names do
+not end with @file{.sh} are @emph{not} added to @file{/etc/profile.d/}
+and are silently dropped.  Package objects can also be provided directly
+to have their @file{etc/bashrc.d/*.sh} prefixed files added.  An example
+usage may look like:
+
+@example
+(use-package-modules gnome)     ;for the `vte' package
+
+(service etc-bashrc-d-service-type
+         (list (file-append vte "/etc/profile.d/vte.sh")))
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index 8584b16ac5c..7083c88c130 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -123,6 +123,7 @@ (define-module (gnu services)
             extra-special-file
             etc-service-type
             etc-profile-d-service-type
+            etc-bashrc-d-service-type
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -988,6 +989,19 @@ (define etc-profile-d-service-type
 scripts having the @file{.sh} file extension, to be sourced when users
 log in.")))
 
+(define files->bashrc-d-directory
+  (make-files->etc-directory "bashrc.d"))
+
+(define etc-bashrc-d-service-type
+  (service-type
+   (inherit etc-profile-d-service-type)
+   (name 'etc-bashrc-d)
+   (extensions (list (service-extension etc-service-type
+                                        files->bashrc-d-directory)))
+   (description "A service for populating @file{/etc/bashrc.d/} with Bash
+scripts having the @file{.sh} file extension, to be sourced by interactive
+Bash shells.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 09fc91383df..0f31c152e0f 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -178,6 +178,19 @@ (define* (run-basic-test os command #:optional (name "basic")
 test \"$PROFILE_D_OK\" = yes")
                                     marionette)))
 
+          (test-assert "/etc/bashrc.d is sourced"
+            (zero? (marionette-eval
+                    '(system* "bash"
+                              ;; Ensure Bash runs interactively.
+                              "--init-file"
+                              #$(plain-file "test_bashrc_d.sh"
+                                            "\
+. /etc/bashrc
+set -e -x
+test -f /etc/bashrc.d/test_bashrc_d.sh
+test \"$BASHRC_D_OK\" = yes"))
+                    marionette)))
+
           (test-equal "special files"
             '#$special-files
             (marionette-eval
@@ -585,15 +598,23 @@ (define* (test-basic-os #:optional (kernel linux-libre))
                  (operating-system
                    (inherit %simple-os)
                    (kernel kernel)
-                   (services (cons (service
-                                    etc-profile-d-service-type
-                                    (list (plain-file
-                                           "test_profile_d.sh"
-                                           "export PROFILE_D_OK=yes\n")
-                                          (plain-file
-                                           "invalid-name"
-                                           "not a POSIX script -- ignore me")))
-                                   %base-services)))
+                   (services (cons* (service
+                                     etc-profile-d-service-type
+                                     (list (plain-file
+                                            "test_profile_d.sh"
+                                            "export PROFILE_D_OK=yes\n")
+                                           (plain-file
+                                            "invalid-name"
+                                            "not a POSIX script -- ignore me")))
+                                    (service
+                                     etc-bashrc-d-service-type
+                                     (list (plain-file
+                                            "test_bashrc_d.sh"
+                                            "export BASHRC_D_OK=yes\n")
+                                           (plain-file
+                                            "invalid-name"
+                                            "not a Bash script -- ignore me")))
+                                    %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
            (vm  (virtual-machine os)))
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, gabriel <at> erlikon.ch, ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:31:03 GMT) Full text and rfc822 format available.

Message #95 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 06/10] system: Migrate sourcing bash_completion.sh to
 etc-bashrc-d-service-type.
Date: Mon, 19 May 2025 09:29:04 +0900
* gnu/system.scm (operating-system-etc-service): Remove block sourcing
bash_completion.sh.
(%base-packages-interactive): Delete bash-completion.
* gnu/services.scm (%default-etc-bashrc-d-files): New variable, which includes
the bash_completion.sh file.
(etc-bashrc-d-service-type): Use it.
* doc/guix.texi (Service Reference): Update documentation.

Change-Id: I2223a5f96f5d761148badc6be29e1c5c80465a1d
---
 doc/guix.texi    | 11 +++++++----
 gnu/services.scm |  8 +++++++-
 gnu/system.scm   | 10 ----------
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 927e9243bfb..746722caa61 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47651,15 +47651,18 @@ Service Reference
 file-like objects, as can be produced with @code{local-file},
 @code{plain-file}, etc.  Note that provided files whose file names do
 not end with @file{.sh} are @emph{not} added to @file{/etc/profile.d/}
-and are silently dropped.  Package objects can also be provided directly
-to have their @file{etc/bashrc.d/*.sh} prefixed files added.  An example
-usage may look like:
+and are silently dropped.  The default value is made available via the
+@var{%default-etc-bashrc-d-files} variable for users to extended.
+Package objects can also be provided directly to have their
+@file{etc/bashrc.d/*.sh} prefixed files added.  An example usage may
+look like:
 
 @example
 (use-package-modules gnome)     ;for the `vte' package
 
 (service etc-bashrc-d-service-type
-         (list (file-append vte "/etc/profile.d/vte.sh")))
+         (append (list (file-append vte "/etc/profile.d/vte.sh"))
+                 %default-etc-bashrc-d-files))
 @end example
 @end defvar
 
diff --git a/gnu/services.scm b/gnu/services.scm
index 7083c88c130..5dbda176b80 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -124,6 +124,7 @@ (define-module (gnu services)
             etc-service-type
             etc-profile-d-service-type
             etc-bashrc-d-service-type
+            %default-etc-bashrc-d-files
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -992,6 +993,10 @@ (define etc-profile-d-service-type
 (define files->bashrc-d-directory
   (make-files->etc-directory "bashrc.d"))
 
+(define %default-etc-bashrc-d-files
+  (list (file-append bash-completion
+                     "/etc/profile.d/bash_completion.sh")))
+
 (define etc-bashrc-d-service-type
   (service-type
    (inherit etc-profile-d-service-type)
@@ -1000,7 +1005,8 @@ (define etc-bashrc-d-service-type
                                         files->bashrc-d-directory)))
    (description "A service for populating @file{/etc/bashrc.d/} with Bash
 scripts having the @file{.sh} file extension, to be sourced by interactive
-Bash shells.")))
+Bash shells.")
+   (default-value %default-etc-bashrc-d-files)))
 
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
diff --git a/gnu/system.scm b/gnu/system.scm
index 0b64927f5ba..50f739c17c7 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -960,7 +960,6 @@ (define %base-packages-interactive
         nvi
         man-db
         info-reader                     ;the standalone Info reader (no Perl)
-        bash-completion
         kbd
         ;; The 'sudo' command is already in %SETUID-PROGRAMS, but we also
         ;; want the other commands and the man pages (notably because
@@ -1146,15 +1145,6 @@ (define* (operating-system-etc-service os)
 # Provide a default prompt.  The user's ~/.bashrc can override it.
 PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
 
-# The 'bash-completion' package.
-if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ]
-then
-  # Bash-completion sources ~/.bash_completion.  It installs a dynamic
-  # completion loader that searches its own completion files as well
-  # as those in ~/.guix-profile and /run/current-system/profile.
-  source /run/current-system/profile/etc/profile.d/bash_completion.sh
-fi
-
 for i in /etc/bashrc.d/*.sh; do
     [[ -r $i ]] && source \"$i\"
 done
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, andrew <at> trop.in, gabriel <at> erlikon.ch, hako <at> ultrarare.space, janneke <at> gnu.org, ludo <at> gnu.org, tanguy <at> bioneland.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:31:06 GMT) Full text and rfc822 format available.

Message #98 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 07/10] system: Factorize bashrc default configuration.
Date: Mon, 19 May 2025 09:29:05 +0900
This factorizes out the remaining bashrc bits from /etc/skel/.bashrc to a the
template used for both /etc/bashrc on Guix System and ~/.bashrc for
home-bash-service-type.

Rationale: The use of /etc/skel introduce state: the file is only copied
originally when the user account is created, and never (automatically)
refreshed again.

* gnu/system.scm (operating-system-etc-service):
<profile>: Guard against souring /etc/bashrc in non-interactive, SSH case.
<bashrc>: Use %default-bashrc, having migrated the remaining definitions to...
* gnu/system/shadow.scm (%default-bashrc): ... here.  Factorize aliases to...
* gnu/services.scm (%default-bash-aliases): ... here.
(%default-bashrc-d-aliases): New variable.
(%default-etc-bashrc-d-files): Include it in the default configuration.
* gnu/services/base.scm (%base-services): Register etc-bashrc-d-service-type.
* gnu/home/services/shells.scm (add-bash-configuration): Do not set PS1, now
part of %default-bashrc.
(home-bash-configuration) [guix-defaults?]: Update doc.
[aliases]: Set %default-bash-aliases as the default value.  Update doc.
* doc/guix.texi (Shells Home Services): Update documentation.
(Service Reference): Update example.

Change-Id: I340c614983a78fd20a9c4a9705e7fc542ae9b513
---
 doc/guix.texi                | 19 +++++++++++--------
 gnu/home/services/shells.scm | 14 +++++++-------
 gnu/services.scm             | 23 +++++++++++++++++++++--
 gnu/services/base.scm        |  5 ++++-
 gnu/system.scm               | 24 +++++++-----------------
 gnu/system/shadow.scm        | 18 ++++++++++--------
 gnu/tests/base.scm           | 17 ++++++++++-------
 7 files changed, 70 insertions(+), 50 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 746722caa61..80a109e2bb3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47654,15 +47654,15 @@ Service Reference
 and are silently dropped.  The default value is made available via the
 @var{%default-etc-bashrc-d-files} variable for users to extended.
 Package objects can also be provided directly to have their
-@file{etc/bashrc.d/*.sh} prefixed files added.  An example usage may
-look like:
+@file{etc/bashrc.d/*.sh} prefixed files added.  Since the service is
+part @code{%base-services}, it can be extended via @code{simple-service}
+like so:
 
 @example
 (use-package-modules gnome)     ;for the `vte' package
 
-(service etc-bashrc-d-service-type
-         (append (list (file-append vte "/etc/profile.d/vte.sh"))
-                 %default-etc-bashrc-d-files))
+(simple-service 'vte-integration etc-bashrc-d-service-type
+                (list (file-append vte "/etc/profile.d/vte.sh")))
 @end example
 @end defvar
 
@@ -49288,8 +49288,11 @@ Shells Home Services
 The Bash package to use.
 
 @item @code{guix-defaults?} (default: @code{#t}) (type: boolean)
-Add sane defaults like reading @file{/etc/bashrc} and coloring the output of
-@command{ls} to the top of the @file{.bashrc} file.
+Add sane defaults like setting @env{PS1}, @env{SHELL}, and ensuring
+@file{/etc/profile} is sourced for non-interactive SSH shells.  If you
+use Guix System, is it safe to set this to @code{#f}, as in this case
+this is already taken care of by the globally installed
+@file{/etc/bashrc}.
 
 @item @code{environment-variables} (default: @code{'()}) (type: alist)
 Association list of environment variables to set for the Bash session.  The
@@ -49297,7 +49300,7 @@ Shells Home Services
 here (@pxref{Essential Home Services}).  The contents of this field will be
 added after the contents of the @code{bash-profile} field.
 
-@item @code{aliases} (default: @code{'()}) (type: alist)
+@item @code{aliases} (default: @code{%default-bash-aliases}) (type: alist)
 Association list of aliases to set for the Bash session.  The aliases
 will be defined after the contents of the @code{bashrc} field has been
 put in the @file{.bashrc} file.  The alias will automatically be quoted,
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index bab5730c3d6..969a3eb8dcf 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -20,6 +20,7 @@
 
 (define-module (gnu home services shells)
   #:use-module (gnu services configuration)
+  #:use-module ((gnu services) #:select (%default-bash-aliases))
   #:autoload   (gnu system shadow) (%default-bashrc %default-zprofile)
   #:use-module (gnu home services utils)
   #:use-module (gnu home services)
@@ -333,9 +334,12 @@ (define-configuration home-bash-configuration
    (package bash)
    "The Bash package to use.")
   (guix-defaults?
+   ;; TODO: Set to #f when the target system is determined to be Guix System.
    (boolean #t)
-   "Add sane defaults like reading @file{/etc/bashrc} and coloring the output of
-@command{ls} to the top of the @file{.bashrc} file.")
+   "Add sane defaults like setting @env{PS1}, @env{SHELL}, and ensuring
+@file{/etc/profile} is sourced for non-interactive SSH shells.  If you use
+Guix System, is it safe to set this to @code{#f}, as in this case this is
+already taken care of by the globally installed @file{/etc/bashrc}.")
   (environment-variables
    (alist '())
    "Association list of environment variables to set for the Bash session.  The
@@ -344,7 +348,7 @@ (define-configuration home-bash-configuration
 added after the contents of the @code{bash-profile} field."
    (serializer serialize-posix-env-vars))
   (aliases
-   (alist '())
+   (alist %default-bash-aliases)
    "Association list of aliases to set for the Bash session.  The aliases will be
 defined after the contents of the @code{bashrc} field has been put in the
 @file{.bashrc} file.  The alias will automatically be quoted, so something line
@@ -423,10 +427,6 @@ (define (add-bash-configuration config)
               'bashrc
               (if (home-bash-configuration-guix-defaults? config)
                   (list (plain-file-content %default-bashrc) "\n"
-                        ;; The host distro might provide a bad 'PS1'
-                        ;; default--e.g., not taking $GUIX_ENVIRONMENT into
-                        ;; account.  Provide a good default here when asked.
-                        "PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '\n"
                         (serialize-field 'aliases))
                   (list (serialize-field 'aliases))))
              (file-if-not-empty 'bash-logout)))))
diff --git a/gnu/services.scm b/gnu/services.scm
index 5dbda176b80..159d357c3e7 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -125,6 +125,7 @@ (define-module (gnu services)
             etc-profile-d-service-type
             etc-bashrc-d-service-type
             %default-etc-bashrc-d-files
+            %default-bash-aliases
             etc-directory
             privileged-program-service-type
             setuid-program-service-type ; deprecated
@@ -993,9 +994,27 @@ (define etc-profile-d-service-type
 (define files->bashrc-d-directory
   (make-files->etc-directory "bashrc.d"))
 
+;;; Use an alist to be compatible with <home-bash-configuration>.
+(define %default-bash-aliases
+  '(("ls" . "ls -p --color=auto")
+    ("ll" . "ls -l")
+    ("grep" . "grep --color=auto")
+    ("ip" . "ip -color=auto")))
+
+;;; ... but avoid the full blown bash-serialize-aliases, which depends on
+;;; other 'guix home' definitions such as `shell-double-quote'.
+(define %default-bashrc-d-aliases
+  (plain-file "aliases.sh"
+              (string-join
+               (map (match-lambda
+                      ((alias . value)
+                       (format #f "~a=~s~%" alias value)))
+                    %default-bash-aliases)
+               "")))
+
 (define %default-etc-bashrc-d-files
-  (list (file-append bash-completion
-                     "/etc/profile.d/bash_completion.sh")))
+  (list (file-append bash-completion "/etc/profile.d/bash_completion.sh")
+        %default-bashrc-d-aliases))
 
 (define etc-bashrc-d-service-type
   (service-type
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 5a3dd2f555d..1f5da97f0a7 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -4138,7 +4138,10 @@ (define %base-services
         (service mingetty-service-type (mingetty-configuration
                                          (tty "tty5")))
         (service mingetty-service-type (mingetty-configuration
-                                         (tty "tty6")))
+                                        (tty "tty6")))
+
+        ;; Extra Bash configuration including Bash completion and aliases.
+        (service etc-bashrc-d-service-type)
 
         (service static-networking-service-type
                  (list %loopback-static-networking))
diff --git a/gnu/system.scm b/gnu/system.scm
index 50f739c17c7..0b251bd3a08 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1132,23 +1132,13 @@ (define* (operating-system-etc-service os)
 done
 unset i
 
-if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
-then
-  # Load Bash-specific initialization code.
-  . /etc/bashrc
+if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]; then
+  # Load Bash-specific initialization code, taking care to not source
+  # /etc/bashrc when invoked from a non-interactive SSH shell,
+  # to avoid recursion (/etc/bashrc also sources /etc/profile
+  # in the non-login, non-interactive SSH case).
+  [[ $- != *i* && -n $SSH_CLIENT ]] || source /etc/bashrc
 fi
-"))
-
-        (bashrc    (plain-file "bashrc" "\
-# Bash-specific initialization.
-
-# Provide a default prompt.  The user's ~/.bashrc can override it.
-PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
-
-for i in /etc/bashrc.d/*.sh; do
-    [[ -r $i ]] && source \"$i\"
-done
-unset i
 ")))
     (service etc-service-type
      `(("os-release" ,os-release)
@@ -1159,7 +1149,7 @@ (define* (operating-system-etc-service os)
        ("issue" ,issue)
        ,@(if nsswitch `(("nsswitch.conf" ,nsswitch)) '())
        ("profile" ,profile)
-       ("bashrc" ,bashrc)
+       ("bashrc" ,%default-bashrc)
        ;; Write the operating-system-host-name to /etc/hostname to prevent
        ;; NetworkManager from changing the system's hostname when connecting
        ;; to certain networks.  Some discussion at
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index b9a5a6134bc..6443fd9922d 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -147,8 +147,11 @@ (define %base-user-accounts
 
 (define %default-bashrc
   (plain-file "bashrc" "\
-# Bash initialization for interactive non-login shells and
-# for remote shells (info \"(bash) Bash Startup Files\").
+# Bash-specific initialization, including for non-login and remote
+# shells (info \"(bash) Bash Startup Files\").
+
+# Provide a default prompt.
+PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
 
 # Export 'SHELL' to child processes.  Programs such as 'screen'
 # honor it and otherwise use /bin/sh.
@@ -165,10 +168,11 @@ (define %default-bashrc
     return
 fi
 
-alias ls='ls -p --color=auto'
-alias ll='ls -l'
-alias grep='grep --color=auto'
-alias ip='ip -color=auto'\n"))
+for i in /etc/bashrc.d/*.sh; do
+    [[ -r $i ]] && source \"$i\"
+done
+unset i
+"))
 
 (define %default-bash-profile
   (plain-file "bash_profile" "\
@@ -289,12 +293,10 @@ (define (default-skeletons)
 'useradd' in the home directory of newly created user accounts."
 
   (let ((profile   %default-bash-profile)
-        (bashrc    %default-bashrc)
         (zprofile  %default-zprofile)
         (xdefaults %default-xdefaults)
         (gdbinit   %default-gdbinit))
     `((".bash_profile" ,profile)
-      (".bashrc" ,bashrc)
       ;; Zsh sources ~/.zprofile before ~/.zshrc, and it sources ~/.zlogin
       ;; after ~/.zshrc.  To avoid interfering with any customizations a user
       ;; may have made in their ~/.zshrc, put this in .zprofile, not .zlogin.
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 0f31c152e0f..db904d7f102 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -187,6 +187,8 @@ (define* (run-basic-test os command #:optional (name "basic")
                                             "\
 . /etc/bashrc
 set -e -x
+test -f /etc/bashrc.d/bash_completion.sh
+test -f /etc/bashrc.d/aliases.sh
 test -f /etc/bashrc.d/test_bashrc_d.sh
 test \"$BASHRC_D_OK\" = yes"))
                     marionette)))
@@ -606,14 +608,15 @@ (define* (test-basic-os #:optional (kernel linux-libre))
                                            (plain-file
                                             "invalid-name"
                                             "not a POSIX script -- ignore me")))
-                                    (service
+                                    (simple-service
+                                     'extra-bashrc-d-files
                                      etc-bashrc-d-service-type
-                                     (list (plain-file
-                                            "test_bashrc_d.sh"
-                                            "export BASHRC_D_OK=yes\n")
-                                           (plain-file
-                                            "invalid-name"
-                                            "not a Bash script -- ignore me")))
+                                     (list  (plain-file
+                                             "test_bashrc_d.sh"
+                                             "export BASHRC_D_OK=yes\n")
+                                            (plain-file
+                                             "invalid-name"
+                                             "not a Bash script -- ignore me")))
                                     %base-services)))
                  #:imported-modules '((gnu services herd)
                                       (guix combinators))))
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, gabriel <at> erlikon.ch, ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:31:10 GMT) Full text and rfc822 format available.

Message #101 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 08/10] services: Add vte-integration-service-type.
Date: Mon, 19 May 2025 09:29:06 +0900
* gnu/services.scm (vte-integration-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.

Change-Id: I7e4bc1b913b50a5a061894f9ddef27f1877b62a2
---
 doc/guix.texi    | 15 +++++++++++++++
 gnu/services.scm | 15 +++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 80a109e2bb3..b53823bc65c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47666,6 +47666,21 @@ Service Reference
 @end example
 @end defvar
 
+@defvar vte-integration-service-type
+This services adds the @file{/etc/bashrc.d/vte.sh} to your system, which
+improves the Bash and Zsh experience when using VTE-powered terminal
+emulators.  This causes for example the current directory to be
+displayed in the terminal emulator's tab title, and the current
+directory to be preserved when creating a new tab, among other features.
+The value of the service is the @code{vte} package to use.
+
+@example
+(use-package-modules gnome)     ;for the `vte' package
+
+(service vte-integration-service-type vte)
+@end example
+@end defvar
+
 @defvar privileged-program-service-type
 Type for the ``privileged-program service''.  This service collects lists of
 executable file names, passed as gexps, and adds them to the set of
diff --git a/gnu/services.scm b/gnu/services.scm
index 159d357c3e7..ce15a39d063 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -47,6 +47,7 @@ (define-module (gnu services)
   #:use-module (guix deprecation)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages hurd)
   #:use-module (gnu packages linux)
   #:use-module (gnu system privilege)
@@ -138,6 +139,7 @@ (define-module (gnu services)
             linux-builder-configuration-kernel
             linux-builder-configuration-modules
             linux-loadable-module-service-type
+            vte-integration-service-type
 
             %boot-service
             %activation-service
@@ -1027,6 +1029,19 @@ (define etc-bashrc-d-service-type
 Bash shells.")
    (default-value %default-etc-bashrc-d-files)))
 
+(define vte-integration-service-type
+  (service-type
+   (name 'vte-integration)
+   (extensions
+    (list (service-extension etc-bashrc-d-service-type
+                             (lambda (vte)
+                               (list (file-append
+                                      vte "/etc/profile.d/vte.sh"))))))
+   (default-value vte)                  ;the vte package to use
+   (description "A service for adding the @file{/etc/bashrc.d/vte.sh} script
+to your system, which improves the Bash and Zsh experience when using
+VTE-powered terminal emulators.")))
+
 (define (privileged-program->activation-gexp programs)
   "Return an activation gexp for privileged-program from PROGRAMS."
   (let ((programs
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, liliana.prikler <at> gmail.com, noelopez <at> free.fr, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:31:11 GMT) Full text and rfc822 format available.

Message #104 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 09/10] services: Add vte-integration-service-type to
 %desktop-services.
Date: Mon, 19 May 2025 09:29:07 +0900
* gnu/services/desktop.scm (desktop-services-for-system):

Fixes: <https://issues.guix.gnu.org/72172>
Fixes: <https://issues.guix.gnu.org/35424>

Change-Id: Ib29468468e327801a4e95361610159de61f7e8d6
---
 gnu/services/desktop.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 12560a6249d..38ff2187356 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -2463,6 +2463,10 @@ (define* (desktop-services-for-system #:optional
          ;; to avoid GDM stale cache and permission issues.
          gdm-file-system-service
 
+         ;; Provides a nicer experience for VTE-using terminal emulators such
+         ;; as GNOME Console, Xfce Terminal, etc.
+         (service vte-integration-service-type)
+
          ;; The global fontconfig cache directory can sometimes contain
          ;; stale entries, possibly referencing fonts that have been GC'd,
          ;; so mount it read-only.
-- 
2.49.0





Information forwarded to maxim.cournoyer <at> gmail.com, rutherther <at> ditigal.xyz, lgcoelho <at> disroot.org, pelzflorian <at> pelzflorian.de, julien <at> lepiller.eu, guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 00:31:12 GMT) Full text and rfc822 format available.

Message #107 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78308 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 10/10] news: Add news entry for etc-bashrc-d-service-type.
Date: Mon, 19 May 2025 09:29:08 +0900
* etc/news.scm (channel-news): New entry.

Change-Id: Iaf861617e871eca90ac28ba5e14876c0f2f0f731
---
 etc/news.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/etc/news.scm b/etc/news.scm
index c70234ece7b..32303253440 100644
--- a/etc/news.scm
+++ b/etc/news.scm
@@ -38,6 +38,23 @@
 (channel-news
  (version 0)
 
+ (entry (commit "XXX")
+        (title
+         (en "New services for /etc/profile.d and /etc/bashrc.d"))
+        (body
+         (en "Two new Shepherd services, @code{etc-profile-d-service-type} and
+@code{etc-bashrc-d-service-type}, can now be used to configure and extend your
+shell.  The services accept a list of file-like objects that must have the
+@file{.sh} file name extension.  @code{etc-bashrc-d-service-type} is now used
+instead of skeleton files to provision the Guix-provided Bash
+aliases (@file{/etc/bashrc.d/aliases.sh}).  It is also used to configure the
+@code{bash-completion} package, by provisioning
+@file{/etc/bashrc.d/bash_completion.sh}.  If your @code{operating-system}
+configuration does not include the @code{%base-services}, you may want to add
+@code{(service etc-bashrc-d-service-type)} to your services, so Bash
+completion will continue working for new users.  See (info \"(guix) Service
+Reference\") for extra information and examples.")))
+
  (entry (commit "6e8ffdf3c5afac265e540027c2332573b25461ae")
         (title
          (en "Linux-libre 6.13 removed from Guix")
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 05:25:03 GMT) Full text and rfc822 format available.

Message #110 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Rutherther <rutherther <at> ditigal.xyz>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 78308 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/9] VTE integration support / Shell startup files refactor
Date: Mon, 19 May 2025 07:24:28 +0200
Hi

On May 19, 2025 2:24:28 AM GMT+02:00, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> wrote:
>Hi Rutherther,
>
>Rutherther <rutherther <at> ditigal.xyz> writes:
>
>> Hi,
>>
>> I've tried playing with this a bit.
>>
>> I would like to point out that maybe it would be better to add extension
>> of the service to the manual rather than creation of the service. Most
>> users will be using profile-d service as they are using
>> desktop-services. So instead of (service-type etc-profile-d-service-type
>> ...) something like (simple-service 'my-simple-profile-file
>> etc-profile-d-service-type ...).
>
>Currently only etc-bashrc-d-service-type is used in %base-services, so
>we can't extend etc-profile-d-service-type, since it doesn't exist in
>the base templates.

But we definitely can! Extensions bring the service in, unconditionally. So they work every time no matter if the service is in the list already. 

>
>> As for the bashrc and profile d, it seems working right and I don't have
>> any more comments apart from documentation changes.
>
>I'm pushing a v3 with the news entry you had suggested in a minute.
>
>> As for vte, I am not really sure what the integration does and have
>> difficulty searching for the features. All I can get is that it
>> integrates with terminal and makes it better, but not in what way. As I
>> am quite a minimal, using dwl and foot, I have no idea how does Gnome
>> and Gnome Terminal integrate nor how to check if it does the right thing
>> with this addition.
>
>The main thing for me is having a consistent title for the tab in gnome
>console or gnome terminal applications.  It also preserves the current
>working directory when opening new tabs, and offers other features.  I
>guess the best way to know what other features it provides is by reading
>the vte.sh script or the source of libvte.
>
>Thanks for reviewing/testing!
>

Rutherther




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 08:39:02 GMT) Full text and rfc822 format available.

Message #113 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Mon, 19 May 2025 10:38:19 +0200
Hi Maxim

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> * etc/news.scm (channel-news): New entry.
[...]
> + (entry (commit "XXX")
> +        (title
> +         (en "New services for /etc/profile.d and /etc/bashrc.d"))
> +        (body
> +         (en "Two new Shepherd services, @code{etc-profile-d-service-type} and
> +@code{etc-bashrc-d-service-type}, can now be used to configure and extend your
>
these are not Shepherd services, right?

also, I wonder if `etc/profile` produced by `build-etc/profile` should
also source files in corresponing `etc/profile.d`. This would allow
packages install shell profile extensions and it would fix e.g.
https://issues.guix.gnu.org/44997




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 12:12:02 GMT) Full text and rfc822 format available.

Message #116 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Mon, 19 May 2025 14:11:40 +0200
[Message part 1 (text/plain, inline)]
This patch series I have not reviewed this time, but could you add this
German translation?

For clarity, I have replaced in the English news and German
> +configuration does not include the @code{%base-services}, you may want to add
by
“ configuration does not include the @code{%base-services} or
@code{%desktop-services}, you may want to add”


I still think command-line commands “See (info \"(guix) Service
Reference\")” should not be enclosed in mere parentheses in displayed
news.

If you follow Sergey Trofimov’s suggestion to replace
> +         (en "Two new Shepherd services,
by “(en "Two new services,” then please replace the German beginning
“(de "Zwei neue Shepherd-Dienste,” by “(de "Zwei neue Dienste,”.

[german-news-bash.scm (text/plain, inline)]
        (title
         (en "New services for /etc/profile.d and /etc/bashrc.d")
         (de "Neue Dienste für /etc/profile.d und /etc/bashrc.d"))
        (body
         (en "Two new Shepherd services, @code{etc-profile-d-service-type} and
@code{etc-bashrc-d-service-type}, can now be used to configure and extend your
shell.  The services accept a list of file-like objects that must have the
@file{.sh} file name extension.  @code{etc-bashrc-d-service-type} is now used
instead of skeleton files to provision the Guix-provided Bash
aliases (@file{/etc/bashrc.d/aliases.sh}).  It is also used to configure the
@code{bash-completion} package, by provisioning
@file{/etc/bashrc.d/bash_completion.sh}.  If your @code{operating-system}
configuration does not include the @code{%base-services} or
@code{%desktop-services}, you may want to add
@code{(service etc-bashrc-d-service-type)} to your services, so Bash
completion will continue working for new users.  See (info \"(guix) Service
Reference\") for extra information and examples.")
         (de "Zwei neue Shepherd-Dienste, @code{etc-profile-d-service-type} und
@code{etc-bashrc-d-service-type}, können jetzt benutzt werden, um Ihre Shell zu
konfigurieren und zu erweitern.  Die Dienste nehmen eine Liste dateiartiger
Objekte entgegen, deren Dateinamen auf die Dateinamenserweiterung @file{.sh}
enden müssen.  @code{etc-bashrc-d-service-type} wird jetzt anstelle von
Skeleton-Dateien benutzt, um von Guix ausgelieferte Bash-Aliasse bereitzustellen
(@file{/etc/bashrc.d/aliases.sh}). Mit ihm wird auch das
@code{bash-completion}-Paket eingerichtet, indem
@file{/etc/bashrc.d/bash_completion.sh} bereitgestellt wird.  Wenn Ihre
Betriebssystemkonfiguration @code{%base-services} oder @code{%desktop-services}
nicht beinhaltet, möchten Sie vielleicht
@code{(service etc-bashrc-d-service-type)} in Ihre Dienstliste aufnehmen, damit
Bash-Komplettierung weiterhin für neue Benutzer Befehle vervollständigt.  Siehe
(info \"(guix.de) Service-Referenz\") für weitere Informationen und
Beispiele.")))
[Message part 3 (text/plain, inline)]

Regards,
Florian

Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 19 May 2025 23:40:02 GMT) Full text and rfc822 format available.

Message #119 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Tue, 20 May 2025 08:39:17 +0900
Hi Sergey,

Sergey Trofimov <sarg <at> sarg.org.ru> writes:

> Hi Maxim
>
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>> * etc/news.scm (channel-news): New entry.
> [...]
>> + (entry (commit "XXX")
>> +        (title
>> +         (en "New services for /etc/profile.d and /etc/bashrc.d"))
>> +        (body
>> +         (en "Two new Shepherd services, @code{etc-profile-d-service-type} and
>> +@code{etc-bashrc-d-service-type}, can now be used to configure and extend your
>>
> these are not Shepherd services, right?

At the core, they are, but they are wrapped with some sugar in Guix, so
perhaps I can say just 'services' or 'Guix services'.

> also, I wonder if `etc/profile` produced by `build-etc/profile` should
> also source files in corresponing `etc/profile.d`. This would allow
> packages install shell profile extensions and it would fix e.g.
> https://issues.guix.gnu.org/44997

That would be useful, but there's one issue I see, is that the Red
Hat/Fedora have standardized on /etc/profile.d/ as the place to put any
shell extension scripts, which are even sourced for example by
/etc/bashrc, which is a bit odd to me: /etc/profile is for interactive
login shells, and /etc/profile.d should logically follow, it seems.

Having /etc/profile.d instead of /etc/bashrc.d also means that scripts
placed there must be POSIX compliant or contain conditional guards for
the specific Shell they target.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 20 May 2025 01:03:02 GMT) Full text and rfc822 format available.

Message #122 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Tue, 20 May 2025 10:01:39 +0900
Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> writes:

> This patch series I have not reviewed this time, but could you add this
> German translation?
>
> For clarity, I have replaced in the English news and German
>> +configuration does not include the @code{%base-services}, you may want to add
> by
> “ configuration does not include the @code{%base-services} or
> @code{%desktop-services}, you may want to add”

Good catch.

> I still think command-line commands “See (info \"(guix) Service
> Reference\")” should not be enclosed in mere parentheses in displayed
> news.

OK, I've made the switch to use @samp{info ...}.

> If you follow Sergey Trofimov’s suggestion to replace
>> +         (en "Two new Shepherd services,
> by “(en "Two new services,” then please replace the German beginning
> “(de "Zwei neue Shepherd-Dienste,” by “(de "Zwei neue Dienste,”.

Thank you, done.

>         (title
>          (en "New services for /etc/profile.d and /etc/bashrc.d")
>          (de "Neue Dienste für /etc/profile.d und /etc/bashrc.d"))
>         (body
>          (en "Two new Shepherd services, @code{etc-profile-d-service-type} and
> @code{etc-bashrc-d-service-type}, can now be used to configure and extend your
> shell.  The services accept a list of file-like objects that must have the
> @file{.sh} file name extension.  @code{etc-bashrc-d-service-type} is now used
> instead of skeleton files to provision the Guix-provided Bash
> aliases (@file{/etc/bashrc.d/aliases.sh}).  It is also used to configure the
> @code{bash-completion} package, by provisioning
> @file{/etc/bashrc.d/bash_completion.sh}.  If your @code{operating-system}
> configuration does not include the @code{%base-services} or
> @code{%desktop-services}, you may want to add
> @code{(service etc-bashrc-d-service-type)} to your services, so Bash
> completion will continue working for new users.  See (info \"(guix) Service
> Reference\") for extra information and examples.")
>          (de "Zwei neue Shepherd-Dienste, @code{etc-profile-d-service-type} und
> @code{etc-bashrc-d-service-type}, können jetzt benutzt werden, um Ihre Shell zu
> konfigurieren und zu erweitern.  Die Dienste nehmen eine Liste dateiartiger
> Objekte entgegen, deren Dateinamen auf die Dateinamenserweiterung @file{.sh}
> enden müssen.  @code{etc-bashrc-d-service-type} wird jetzt anstelle von
> Skeleton-Dateien benutzt, um von Guix ausgelieferte Bash-Aliasse bereitzustellen
> (@file{/etc/bashrc.d/aliases.sh}). Mit ihm wird auch das
> @code{bash-completion}-Paket eingerichtet, indem
> @file{/etc/bashrc.d/bash_completion.sh} bereitgestellt wird.  Wenn Ihre
> Betriebssystemkonfiguration @code{%base-services} oder @code{%desktop-services}
> nicht beinhaltet, möchten Sie vielleicht
> @code{(service etc-bashrc-d-service-type)} in Ihre Dienstliste aufnehmen, damit
> Bash-Komplettierung weiterhin für neue Benutzer Befehle vervollständigt.  Siehe
> (info \"(guix.de) Service-Referenz\") für weitere Informationen und
> Beispiele.")))

I applied your version (locally) with the extra translation.  Thank you!

I'll push it in a few days if there are no new issues/concerns reported
here.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 20 May 2025 05:46:02 GMT) Full text and rfc822 format available.

Message #125 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Tue, 20 May 2025 07:45:47 +0200
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

>>> * etc/news.scm (channel-news): New entry.
>> [...]
>>> + (entry (commit "XXX")
>>> +        (title
>>> +         (en "New services for /etc/profile.d and /etc/bashrc.d"))
>>> +        (body
>>> +         (en "Two new Shepherd services, @code{etc-profile-d-service-type} and
>>> +@code{etc-bashrc-d-service-type}, can now be used to configure and extend your
>>>
>> these are not Shepherd services, right?
>
> At the core, they are, but they are wrapped with some sugar in Guix,
>

Could you please explain this bit? As I see these are just computed
files that produce `profile.d` and `bashrc.d` unions which are then
sourced by a piece of code placed in a well-known file. When I read
"shepherd", I expect that the service is managed with "herd".

> 
> so perhaps I can say just 'services' or 'Guix services'.

>> also, I wonder if `etc/profile` produced by `build-etc/profile` should
>> also source files in corresponing `etc/profile.d`. This would allow
>> packages install shell profile extensions and it would fix e.g.
>> https://issues.guix.gnu.org/44997
>
> That would be useful, but there's one issue I see, is that the Red
> Hat/Fedora have standardized on /etc/profile.d/ as the place to put any
> shell extension scripts, which are even sourced for example by
> /etc/bashrc, which is a bit odd to me: /etc/profile is for interactive
> login shells, and /etc/profile.d should logically follow, it seems.
>
> Having /etc/profile.d instead of /etc/bashrc.d also means that scripts
> placed there must be POSIX compliant or contain conditional guards for
> the specific Shell they target.

It seems I've phrased it a bit vague. I was writing about `profile.d`
directories in any guix profile (be it `guix home`, `guix shell` or
whatever). What I propose is that `<...>/etc/profile` (produced by
`build-etc/profile` procedure) would include the snippet to source
`profile.d`. The snippet could find the dir relative to its own location
so that the very same code could be placed as in the global file
(/etc/profile) as in per-profile files.




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 20 May 2025 07:39:02 GMT) Full text and rfc822 format available.

Message #128 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Tue, 20 May 2025 16:38:37 +0900
Hi Sergey,

Sergey Trofimov <sarg <at> sarg.org.ru> writes:

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>>>> * etc/news.scm (channel-news): New entry.
>>> [...]
>>>> + (entry (commit "XXX")
>>>> +        (title
>>>> +         (en "New services for /etc/profile.d and /etc/bashrc.d"))
>>>> +        (body
>>>> +         (en "Two new Shepherd services, @code{etc-profile-d-service-type} and
>>>> +@code{etc-bashrc-d-service-type}, can now be used to configure and extend your
>>>>
>>> these are not Shepherd services, right?
>>
>> At the core, they are, but they are wrapped with some sugar in Guix,
>>
>
> Could you please explain this bit? As I see these are just computed
> files that produce `profile.d` and `bashrc.d` unions which are then
> sourced by a piece of code placed in a well-known file. When I read
> "shepherd", I expect that the service is managed with "herd".

Ah, you are right!  Re-reading (info "(guix) Service Composition") made
that clear to me.  I always assumed services had to be sequenced by
Shepherd no matter the type, but it seems it is Guix System that is in
charge during the early boot here, when running the activation script,
IIUC.

>>> also, I wonder if `etc/profile` produced by `build-etc/profile` should
>>> also source files in corresponing `etc/profile.d`. This would allow
>>> packages install shell profile extensions and it would fix e.g.
>>> https://issues.guix.gnu.org/44997
>>
>> That would be useful, but there's one issue I see, is that the Red
>> Hat/Fedora have standardized on /etc/profile.d/ as the place to put any
>> shell extension scripts, which are even sourced for example by
>> /etc/bashrc, which is a bit odd to me: /etc/profile is for interactive
>> login shells, and /etc/profile.d should logically follow, it seems.
>>
>> Having /etc/profile.d instead of /etc/bashrc.d also means that scripts
>> placed there must be POSIX compliant or contain conditional guards for
>> the specific Shell they target.
>
> It seems I've phrased it a bit vague. I was writing about `profile.d`
> directories in any guix profile (be it `guix home`, `guix shell` or
> whatever). What I propose is that `<...>/etc/profile` (produced by
> `build-etc/profile` procedure) would include the snippet to source
> `profile.d`. The snippet could find the dir relative to its own location
> so that the very same code could be placed as in the global file
> (/etc/profile) as in per-profile files.

Thank you for clarifying what you meant.  So just rephrasing to make
extra sure, what you would like to see is that every profile generated
would have in their etc/profile generated file something sourcing its
etc/profile.d/*.sh files, so that installing e.g. bash_completion in a
profile would automatically have its etc/profile.d/bash_completion.sh
file sourced, correct?

I'm not sure how useful that would be, because IIRC the
$profile/etc/profile of a generated profile is only ever sourced:

1. When it appears at /etc/profile, e.g. mapped there within a
container
2. The shell is started as a login shell, e.g. 'bash --login'

Note the --login requirement; which would not be in effect for example
when entering a 'guix shell' (which spawns 'sh') by default.  The
etc/profile could be sourced manually, of course, but that seems to
defeat the purpose of having it there in the first place.

Another idea would be to have /etc/bashrc source /etc/profile.d like
done in Fedora; that's a bit odd and I don't like it much for reasons
explained earlier, but it has the benefit of being compatible with the
packages like flatpak and vte that install things under etc/profile.d to
extend the non-login shells as well.  That could be made to work
automatically for the fixed location like
/run/current-system/profile/etc/profile.d for system-installed packages
as well as $HOME/.profile/etc/profile.d/, and even for non-containerized
environments via $GUIX_ENVIRONMENT/etc/profile.d/.  It wouldn't work in
containerized environment; this would need adding a /etc/bashrc inside
the container that would source $GUIX_ENVIROMNENT/etc/profile.d.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 20 May 2025 09:04:01 GMT) Full text and rfc822 format available.

Message #131 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Tue, 20 May 2025 11:03:33 +0200
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

[...]
>>>> also, I wonder if `etc/profile` produced by `build-etc/profile` should
>>>> also source files in corresponing `etc/profile.d`. This would allow
>>>> packages install shell profile extensions and it would fix e.g.
>>>> https://issues.guix.gnu.org/44997
>>>
>>> That would be useful, but there's one issue I see, is that the Red
>>> Hat/Fedora have standardized on /etc/profile.d/ as the place to put any
>>> shell extension scripts, which are even sourced for example by
>>> /etc/bashrc, which is a bit odd to me: /etc/profile is for interactive
>>> login shells, and /etc/profile.d should logically follow, it seems.
>>>
>>> Having /etc/profile.d instead of /etc/bashrc.d also means that scripts
>>> placed there must be POSIX compliant or contain conditional guards for
>>> the specific Shell they target.
>>
>> It seems I've phrased it a bit vague. I was writing about `profile.d`
>> directories in any guix profile (be it `guix home`, `guix shell` or
>> whatever). What I propose is that `<...>/etc/profile` (produced by
>> `build-etc/profile` procedure) would include the snippet to source
>> `profile.d`. The snippet could find the dir relative to its own location
>> so that the very same code could be placed as in the global file
>> (/etc/profile) as in per-profile files.
>
> Thank you for clarifying what you meant.  So just rephrasing to make
> extra sure, what you would like to see is that every profile generated
> would have in their etc/profile generated file something sourcing its
> etc/profile.d/*.sh files, so that installing e.g. bash_completion in a
> profile would automatically have its etc/profile.d/bash_completion.sh
> file sourced, correct?

Exactly. Basically, install the "for i in /etc/profile.d/*.sh; do"
snippet adjusted to look for `profile.d` relative to current file.

>
> I'm not sure how useful that would be, because IIRC the
> $profile/etc/profile of a generated profile is only ever sourced:
>
> 1. When it appears at /etc/profile, e.g. mapped there within a
> container

... or is one of the default user profiles:

--8<---------------cut here---------------start------------->8---
# from /etc/profile

for profile in "$HOME/.guix-profile"        \
               "$HOME/.guix-home/profile"   \
               "$HOME/.config/guix/current"
do
  if [ -f "$profile/etc/profile" ]
  then
    # Load the user profile's settings.
    GUIX_PROFILE="$profile" ; \
    . "$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"
  fi
done
--8<---------------cut here---------------end--------------->8---

this alone is already helpful as it resolves the flatpak bug
granted, custom profiles are not sourced by `/etc/profile`, but then
it's a power-user territory and they'll sort it out themselves.

> 2. The shell is started as a login shell, e.g. 'bash --login'
> Note the --login requirement; which would not be in effect for example
> when entering a 'guix shell' (which spawns 'sh') by default.  The
> etc/profile could be sourced manually, of course, but that seems to
> defeat the purpose of having it there in the first place.
>

This is a tougher nut to crack, could be done separately. On a first
glance it seems logical that 'guix shell' would start login shells,
however this would lead to duplicated search paths as these would be set
when starting the container and then when sourcing /etc/profile inside.
It could be remedied with such steps:

- Extract mandatory search path variables (PATH=, MANPATH=, etc) to a
  separate file (e.g. profile.env).

- Prevent 'profile.env' files to be sourced twice:
  if [ "GUIX_PROFILE_<hash>_LOADED" -ne 1 ]; then
     export PATH=...
     ...
     GUIX_PROFILE_<hash>_LOADED=1
  fi

- 'guix/scripts/environment.scm' procedures should be adjusted to
  additionally set 'GUIX_PROFILE_<hash>_LOADED' env variable to avoid
  duplication of search paths

>
> Another idea would be to have /etc/bashrc source /etc/profile.d like
> done in Fedora; that's a bit odd and I don't like it much for reasons
> explained earlier, but it has the benefit of being compatible with the
> packages like flatpak and vte that install things under etc/profile.d to
> extend the non-login shells as well.

I also don't like this idea. Why would non-login shells run
`/etc/profile.d`? Aren't they launched in environment where login
happened and therefore `/etc/profile` got applied already?

> That could be made to work automatically for the fixed location like
> /run/current-system/profile/etc/profile.d for system-installed
> packages as well as $HOME/.profile/etc/profile.d/, and even for
> non-containerized environments via $GUIX_ENVIRONMENT/etc/profile.d/.
> It wouldn't work in containerized environment; this would need adding
> a /etc/bashrc inside the container that would source
> $GUIX_ENVIROMNENT/etc/profile.d.




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Tue, 20 May 2025 11:22:02 GMT) Full text and rfc822 format available.

Message #134 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Tue, 20 May 2025 13:21:33 +0200
[Message part 1 (text/plain, inline)]
Hi Maxim,

a follow-up to my previous reply containing my proposal materialised to
a patch.

[0001-source-profile.d-as-intended.patch (text/x-patch, inline)]
From c674d1fdf83bb1bc7930b48f9c0333f2936563d2 Mon Sep 17 00:00:00 2001
Message-ID: <c674d1fdf83bb1bc7930b48f9c0333f2936563d2.1747739946.git.sarg <at> sarg.org.ru>
From: Sergey Trofimov <sarg <at> sarg.org.ru>
Date: Tue, 20 May 2025 13:18:29 +0200
Subject: [PATCH] source profile.d as intended

Change-Id: I37c0980ca66b2bfb8516df26d3376b16a009f855
---
 gnu/system.scm               | 10 +---------
 guix/build/profiles.scm      | 25 +++++++++++++++++++++++--
 guix/profiles.scm            |  4 +++-
 guix/scripts/environment.scm |  4 ++--
 4 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 2beca4b6d0..0969228f0a 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1134,15 +1134,7 @@ (define* (operating-system-etc-service os)
 
 # Provide a default prompt.  The user's ~/.bashrc can override it.
 PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '
-
-# The 'bash-completion' package.
-if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ]
-then
-  # Bash-completion sources ~/.bash_completion.  It installs a dynamic
-  # completion loader that searches its own completion files as well
-  # as those in ~/.guix-profile and /run/current-system/profile.
-  source /run/current-system/profile/etc/profile.d/bash_completion.sh
-fi\n")))
+")))
     (service etc-service-type
      `(("os-release" ,os-release)
        ("services" ,(file-append net-base "/etc/services"))
diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm
index b19d93f971..a4854386fb 100644
--- a/guix/build/profiles.scm
+++ b/guix/build/profiles.scm
@@ -98,9 +98,30 @@ (define (build-etc/profile output search-paths)
 # to this specific profile generation.
 \n" port)
       (let ((variables (evaluate-search-paths search-paths
-                                              (list output))))
+                                              (list output)))
+            (profile-d (string-append output "/etc/profile.d"))
+            (guard-flag (string-append "GUIX_PROFILE_"
+                                       (string-take (basename output) 32)
+                                       "_LOADED")))
+
+        (format port "if [ \"x$~a\" = x ]; then\n" guard-flag)
         (for-each (write-environment-variable-definition port)
-                  (map (abstract-profile output) variables))))))
+                  (map (abstract-profile output) variables))
+
+        (format port "
+~a=1
+fi
+
+for i in ~a/*.sh; do
+    if [ -r \"$i\" ]; then
+        if [ \"${-#*i}\" != \"$-\" ]; then
+            . \"$i\"
+        else
+            . \"$i\" >/dev/null
+        fi
+    fi
+done"
+                guard-flag profile-d)))))
 
 (define* (ensure-writable-directory directory
                                     #:key (symlink symlink))
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 264396401e..68ad6a6bc5 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -2165,7 +2165,9 @@ (define* (load-profile profile
                                  (string-append value separator current)
                                  value)
                              value)))))
-            (profile-search-paths profile manifest)))
+            (profile-search-paths profile manifest))
+  (setenv (string-append "GUIX_PROFILE_" (string-take (basename profile) 32)
+                         "_LOADED") "1"))
 
 (define (profile-regexp profile)
   "Return a regular expression that matches PROFILE's name and number."
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 96bbc6c9fa..839ad7ce97 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -1123,8 +1123,8 @@ (define (guix-environment* opts)
                        (if container?
                            ;; The user's shell is likely not available
                            ;; within the container.
-                           '("/bin/sh")
-                           (list %default-shell))))
+                           '("/bin/sh" "--login")
+                           (list %default-shell "--login"))))
          (mappings   (pick-all opts 'file-system-mapping))
          (white-list (pick-all opts 'inherit-regexp)))
 

base-commit: e7d73a08d569904f8a71db5b84f5fafaf0dff188
-- 
2.49.0


Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Wed, 21 May 2025 00:13:01 GMT) Full text and rfc822 format available.

Message #137 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Wed, 21 May 2025 09:11:56 +0900
Hi Sergey,

Thanks for the brainstorm / ideas, even patch!

[...]

> I also don't like this idea. Why would non-login shells run
> `/etc/profile.d`? Aren't they launched in environment where login
> happened and therefore `/etc/profile` got applied already?

That's what I initially thought, and I originally didn't see an
immediate need for etc-bashrc-d-service-type, but upon testing with the
/etc/profile.d/vte.sh file installed for example, at least in GNOME
Console it wouldn't take effect.  Perhaps the environment is cleaned up
by GNOME Console and it expects the shell, e.g. Bash, to source
/etc/profile.d/vte.sh from bashrc (GNOME Console starts the shell as an
interactive, non-login shell).  I had tested in an actual VM.

Are you sure that it would help for the flatpak cases (have you actually
tested it?).

Reading flatpak.sh, I assume it would work, as long as flatpak is
installed to the given profile, as it needs to be available on PATH when
/etc/profile is sourced, which should be the case if the snippet is
added below the existing variable exports in ~/.guix-profile/etc/profile
(which contain PATH=).

I'll try taking a look at your snippet.  The guard avoiding double
sourcing /etc/profile looks interesting, perhaps already useful to guard
against bug#23118 for example?

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Wed, 21 May 2025 00:18:02 GMT) Full text and rfc822 format available.

Message #140 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Wed, 21 May 2025 09:17:37 +0900
Hi again,

Sergey Trofimov <sarg <at> sarg.org.ru> writes:

I just had a look a vte.sh, and I think I now understand why that
particular one wouldn't work as /etc/profile.d/vte.sh:

--8<---------------cut here---------------start------------->8---
# Not bash or zsh?
[ -n "${BASH_VERSION:-}" -o -n "${ZSH_VERSION:-}" ] || return 0

# Not an interactive shell?
[[ $- == *i* ]] || return 0

# Not running under vte?
[ "${VTE_VERSION:-0}" -ge 3405 ] || return 0

# TERM not supported?
case "$TERM" in
    xterm*|vte*|gnome*) :;;
    *) return 0 ;;
esac
--8<---------------cut here---------------end--------------->8---

I guess at least the VTE_VERSION check would cause the script to return
early for the login shell, which is not run from a VTE-powered terminal.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#78308; Package guix-patches. (Mon, 26 May 2025 03:09:02 GMT) Full text and rfc822 format available.

Message #143 received at 78308 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, 78308 <at> debbugs.gnu.org,
 Julien Lepiller <julien <at> lepiller.eu>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Mon, 26 May 2025 12:08:35 +0900
Hi Sergey,

Sergey Trofimov <sarg <at> sarg.org.ru> writes:

> Hi Maxim,
>
> a follow-up to my previous reply containing my proposal materialised to
> a patch.
>
> From c674d1fdf83bb1bc7930b48f9c0333f2936563d2 Mon Sep 17 00:00:00 2001
> Message-ID: <c674d1fdf83bb1bc7930b48f9c0333f2936563d2.1747739946.git.sarg <at> sarg.org.ru>
> From: Sergey Trofimov <sarg <at> sarg.org.ru>
> Date: Tue, 20 May 2025 13:18:29 +0200
> Subject: [PATCH] source profile.d as intended

Would you mind to rebase this change on current master, where I've
merged this series without this last addition (for now) ?  I'd like some
extra time to play with it/test it.  Could you create a new PR for it on
our Codeberg?

--
Thanks,
Maxim




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Mon, 26 May 2025 13:03:01 GMT) Full text and rfc822 format available.

Notification sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
bug acknowledged by developer. (Mon, 26 May 2025 13:03:02 GMT) Full text and rfc822 format available.

Message #148 received at 78308-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: Luis Guilherme Coelho <lgcoelho <at> disroot.org>,
 Rutherther <rutherther <at> ditigal.xyz>, Julien Lepiller <julien <at> lepiller.eu>,
 78308-done <at> debbugs.gnu.org, Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#78308] [PATCH v3 10/10] news: Add news entry for
 etc-bashrc-d-service-type.
Date: Mon, 26 May 2025 22:02:23 +0900
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> Hi Sergey,
>
> Sergey Trofimov <sarg <at> sarg.org.ru> writes:
>
>> Hi Maxim,
>>
>> a follow-up to my previous reply containing my proposal materialised to
>> a patch.
>>
>> From c674d1fdf83bb1bc7930b48f9c0333f2936563d2 Mon Sep 17 00:00:00 2001
>> Message-ID: <c674d1fdf83bb1bc7930b48f9c0333f2936563d2.1747739946.git.sarg <at> sarg.org.ru>
>> From: Sergey Trofimov <sarg <at> sarg.org.ru>
>> Date: Tue, 20 May 2025 13:18:29 +0200
>> Subject: [PATCH] source profile.d as intended
>
> Would you mind to rebase this change on current master, where I've
> merged this series without this last addition (for now) ?  I'd like some
> extra time to play with it/test it.  Could you create a new PR for it on
> our Codeberg?

Closing this one for now!  Please add me as reviewer after you could
submit your improvement on top in a Codeberg PR!

-- 
Thanks,
Maxim




This bug report was last modified 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.