-# If not running interactively, don't do anything else
-[[ $- != *i* ]] && return
+# Bash initialization for interactive non-login shells and
+# for remote shells (info "(bash) Bash Startup Files").
+
+# Export 'SHELL' to child processes. Programs such as 'screen'
+# honor it and otherwise use /bin/sh.
+export SHELL
+
+if [[ $- != *i* ]]
+then
+ # We are being invoked from a non-interactive shell. If this
+ # is an SSH session (as in "ssh host command"), source
+ # /etc/profile so we get PATH and other essential variables.
+ [[ -n "$SSH_CLIENT" ]] && source /etc/profile
+
+ # Don't do anything else.
+ return
+fi
+
+if [ -n "$IS_GUIX_SYSTEM" ]; then
+ # Source the system-wide file.
+ source /etc/bashrc
+fi
+
+# from https://unix.stackexchange.com/a/55935
+b_prompt() {
+ cwd=$(sed -e "s:$HOME:~:" -e "s:\(\.\?[^/]\)[^/]*/:\1/:g" <<<$PWD)
+ printf $cwd
+}
+
+if [ $(id -u) == "0" ]; then
+ PS1='`printf "\[\e[1;31m\]\$\[\e[00m\]"` '
+else
+ PS1='\$ '
+fi
+PS1="`[ -n "$GUIX_ENVIRONMENT" ] && printf \" [env]\"`\n$PS1"
+__u='`[ \`id -u\` == "0" ] && printf "\[\e[1;31m\]\u\[\e[00m\]" || printf "\u"`'
+PS1="$__u@\h:\w/$PS1"
+
+# set terminal title
+PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: $(b_prompt)\007"'