+sys_create_shell_completion()
+{ # Symlink supported shell completions system-wide
+
+ var_guix=/var/guix/profiles/per-user/root/current-guix
+ bash_completion=/etc/bash_completion.d
+ zsh_completion=/usr/share/zsh/site-functions
+ fish_completion=/usr/share/fish/vendor_completions.d
+
+ { # Just in case
+ for dir_shell in $bash_completion $zsh_completion $fish_completion; do
+ [ -d "$dir_shell" ] || mkdir -p $dir_shell
+ done;
+
+ ln -sf ${var_guix}/etc/bash_completion.d/* "$bash_completion";
+ ln -sf ${var_guix}/share/zsh/site-functions/* "$zsh_completion";
+ ln -sf ${var_guix}/share/fish/vendor_completions.d/* "$fish_completion"; } &&
+ _msg "${PAS}installed shell completion"
+}
+
+sys_customize_bashrc()
+{
+ prompt_yes_no "Customize users Bash shell prompt for Guix?" || return
+ for bashrc in /home/*/.bashrc /root/.bashrc; do
+ test -f "$bashrc" || continue
+ grep -Fq '$GUIX_ENVIRONMENT' "$bashrc" && continue
+ cp "${bashrc}" "${bashrc}.bak"
+ echo '
+# Automatically added by the Guix install script.
+if [ -n "$GUIX_ENVIRONMENT" ]; then
+ if [[ $PS1 =~ (.*)"\\$" ]]; then
+ PS1="${BASH_REMATCH[1]} [env]\\\$ "
+ fi
+fi
+' >> "$bashrc"
+ done
+ _msg "${PAS}Bash shell prompt successfully customized for Guix"
+}
+