summaryrefslogtreecommitdiffstats
path: root/tv/2configs/bash/default.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-06-04 15:06:22 +0200
committertv <tv@krebsco.de>2017-06-04 15:06:56 +0200
commit1f8ef7803e0df423532cf8fbdd6d83250ab52bd6 (patch)
treec77da27737209ec208ef2db397f99249bb616212 /tv/2configs/bash/default.nix
parentd18eb5ccd1ec6cc0b7797ac72d8bb258689a544b (diff)
tv: move bash config to dedicated directory
Diffstat (limited to 'tv/2configs/bash/default.nix')
-rw-r--r--tv/2configs/bash/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix
new file mode 100644
index 00000000..40c0725e
--- /dev/null
+++ b/tv/2configs/bash/default.nix
@@ -0,0 +1,37 @@
+{ config, lib, pkgs, ... }:
+
+with import <stockholm/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
+ '';
+ };
+}