diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-08 11:03:35 +0900 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-26 13:43:03 +0900 |
commit | c743d646ee9104aa14d066cdf6657a0fac82ebea (patch) | |
tree | 0cbd78ae16fbbbfec8344b031f7f10dce407a571 /gnu/tests | |
parent | 45b883a9d33ff3bfd0bdb9c9eeea4d64eb73e10c (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.scm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 0f31c152e0..db904d7f10 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -187,6 +187,8 @@ test \"$PROFILE_D_OK\" = yes") "\ . /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 @@ functionality tests, using the given KERNEL.") (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)))) |