summaryrefslogtreecommitdiff
path: root/gnu/tests
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-05-08 11:03:35 +0900
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-05-26 13:43:03 +0900
commitc743d646ee9104aa14d066cdf6657a0fac82ebea (patch)
tree0cbd78ae16fbbbfec8344b031f7f10dce407a571 /gnu/tests
parent45b883a9d33ff3bfd0bdb9c9eeea4d64eb73e10c (diff)
system: Factorize bashrc default configuration.
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
Diffstat (limited to 'gnu/tests')
-rw-r--r--gnu/tests/base.scm17
1 files changed, 10 insertions, 7 deletions
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 @@ test \"$PROFILE_D_OK\" = yes")
187 "\ 187 "\
188. /etc/bashrc 188. /etc/bashrc
189set -e -x 189set -e -x
190test -f /etc/bashrc.d/bash_completion.sh
191test -f /etc/bashrc.d/aliases.sh
190test -f /etc/bashrc.d/test_bashrc_d.sh 192test -f /etc/bashrc.d/test_bashrc_d.sh
191test \"$BASHRC_D_OK\" = yes")) 193test \"$BASHRC_D_OK\" = yes"))
192 marionette))) 194 marionette)))
@@ -606,14 +608,15 @@ functionality tests, using the given KERNEL.")
606 (plain-file 608 (plain-file
607 "invalid-name" 609 "invalid-name"
608 "not a POSIX script -- ignore me"))) 610 "not a POSIX script -- ignore me")))
609 (service 611 (simple-service
612 'extra-bashrc-d-files
610 etc-bashrc-d-service-type 613 etc-bashrc-d-service-type
611 (list (plain-file 614 (list (plain-file
612 "test_bashrc_d.sh" 615 "test_bashrc_d.sh"
613 "export BASHRC_D_OK=yes\n") 616 "export BASHRC_D_OK=yes\n")
614 (plain-file 617 (plain-file
615 "invalid-name" 618 "invalid-name"
616 "not a Bash script -- ignore me"))) 619 "not a Bash script -- ignore me")))
617 %base-services))) 620 %base-services)))
618 #:imported-modules '((gnu services herd) 621 #:imported-modules '((gnu services herd)
619 (guix combinators)))) 622 (guix combinators))))