diff options
author | tv <tv@krebsco.de> | 2016-07-23 13:11:33 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-07-23 13:11:33 +0200 |
commit | 018f498918d0bd8c0f9c5c3324221afffc95bc67 (patch) | |
tree | a4f4dc45b050fa0ba7846cc510cd9cd67f1824a8 /tv/2configs/bash.nix | |
parent | 448145ae02e2d39631ec50585e63c29ca65700b6 (diff) |
tv bash: init
Diffstat (limited to 'tv/2configs/bash.nix')
-rw-r--r-- | tv/2configs/bash.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tv/2configs/bash.nix b/tv/2configs/bash.nix new file mode 100644 index 0000000..fe87aa8 --- /dev/null +++ b/tv/2configs/bash.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +with config.krebs.lib; + +{ + programs.bash = { + interactiveShellInit = '' + HISTCONTROL='erasedups:ignorespace' + HISTSIZE=65536 + HISTFILESIZE=$HISTSIZE + + shopt -s checkhash + shopt -s histappend histreedit histverify + shopt -s no_empty_cmd_completion + complete -d cd + ''; + promptInit = '' + case $UID in + 0) + PS1='\[\e[1;31m\]\w\[\e[0m\] ' + ;; + ${toString config.krebs.build.user.uid}) + PS1='\[\e[1;32m\]\w\[\e[0m\] ' + ;; + *) + PS1='\[\e[1;35m\]\u \[\e[1;32m\]\w\[\e[0m\] ' + ;; + esac + if test -n "$SSH_CLIENT"; then + PS1='\[\e[35m\]\h'" $PS1" + fi + if test -n "$SSH_AGENT_PID"; then + PS1="ssh-agent[$SSH_AGENT_PID] $PS1" + fi + ''; + }; +} |