Subject: [bug#78308] [PATCH v2 4/9] system: Source scripts from the /etc/bashrc.d directory.

From: Maxim Cournoyer <[email-masked]>
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 <[email-masked]>
 ;;; Copyright © 2020, 2021 Brice Waegeneire <[email-masked]>
 ;;; Copyright © 2020 Florian Pelz <[email-masked]>
-;;; Copyright © 2020, 2022 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2020, 2022, 2025 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <[email-masked]>
 ;;; Copyright © 2020, 2022, 2025 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2021 Maxime Devos <[email-masked]>
@@ -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