forked from rarias/jungle
Use nicer prompt in bash when outside a nix shell
This commit is contained in:
parent
fcc9719ccd
commit
02d9f5a062
@ -28,9 +28,22 @@
|
||||
VISUAL = "vim";
|
||||
};
|
||||
|
||||
programs.bash.promptInit = ''
|
||||
PS1="\h\\$ "
|
||||
'';
|
||||
programs.bash.promptInit = # bash
|
||||
''
|
||||
if echo "$PATH" | grep -qc '/nix/store'; then
|
||||
# Inside a nix shell, dumb prompt
|
||||
PS1="\h\\$ "
|
||||
elif [ "$TERM" != "dumb" ] ; then
|
||||
PROMPT_COLOR="1;31m"
|
||||
((UID)) && PROMPT_COLOR="1;32m"
|
||||
|
||||
PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] "
|
||||
|
||||
if test "$TERM" = "xterm"; then
|
||||
PS1="\[\033]2;\h:\u:\w\007\]$PS1"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
|
||||
time.timeZone = "Europe/Madrid";
|
||||
i18n.defaultLocale = "en_DK.UTF-8";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user