diff --git a/gnu/system.scm b/gnu/system.scm index 5a3842f..45d1424 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -355,6 +355,8 @@ explicitly appear in OS." e2fsprogs kbd + bash-completion + ;; The packages below are also in %FINAL-INPUTS, so take them from ;; there to avoid duplication. (map canonical-package @@ -461,6 +463,23 @@ export GIT_SSL_CAINFO=\"$SSL_CERT_FILE\" # Allow Aspell to find dictionaries installed in the user profile. export ASPELL_CONF=\"dict-dir $HOME/.guix-profile/lib/aspell\" ")) + + (bashrc (text-file "bashrc" "\ +# Bash-specific initialization. + +# The 'bash-completion' package. +if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ] +then + source /run/current-system/profile/etc/profile.d/bash_completion.sh +fi + +# Automatic completion loading from the user profile +# (info \"(bash) Programmable Completion\"). +_completion_loader() + { + . \"$HOME/.guix-profile/etc/bash_completion.d/$1.sh\" >/dev/null 2>&1 && return 124 + } +complete -D -F _completion_loader -o bashdefault -o default\n")) (skel (skeleton-directory skeletons))) (file-union "etc" `(("services" ,#~(string-append #$net-base "/etc/services")) @@ -474,6 +493,7 @@ export ASPELL_CONF=\"dict-dir $HOME/.guix-profile/lib/aspell\" ("skel" ,#~#$skel) ("shells" ,#~#$shells) ("profile" ,#~#$profile) + ("bashrc" ,#~#$bashrc) ("hosts" ,#~#$hosts-file) ("localtime" ,#~(string-append #$tzdata "/share/zoneinfo/" #$timezone))