From 5cdb4e421a809de51c3ebe8404e50d732721238b Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 26 Sep 2021 21:26:36 +0530 Subject: init --- programs/bash.nix | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 programs/bash.nix (limited to 'programs/bash.nix') diff --git a/programs/bash.nix b/programs/bash.nix new file mode 100644 index 0000000..cbba2de --- /dev/null +++ b/programs/bash.nix @@ -0,0 +1,88 @@ +{ config +, pkgs +, ... +}: + +{ + programs.bash = { + enable = true; + historyControl = [ "erasedups" ]; + historyFile = "\$HOME/.bash_history"; + historyFileSize = 2000; + historyIgnore = [ "ls" "exit" "kill" ]; + historySize = 1000; + shellAliases = { + "..." = "cd -- ../.."; + grep = "grep --color=auto"; + l = "ls -CF"; + la = "ls -A"; + ll = "ls -alF"; + ls = "ls -F --color=always"; + o = "xdg-open"; + rless = "less -r"; + tmux = "tmux -u"; + tree = "tree -C"; + vim = "nvim"; + tb = "nc termbin.com 9999"; + + # git aliases + gb = "git branch -v"; + gc = "git commit --verbose"; + gd = "git diff --minimal"; + ggp = "git push"; + gl = "git log -p --abbrev-commit --pretty=medium"; + glo = "git log --pretty=oneline --abbrev-commit"; + gst = "git status --short"; + }; + shellOptions = [ + "histappend" + "autocd" + "globstar" + "checkwinsize" + "cdspell" + "dirspell" + "expand_aliases" + "dotglob" + "gnu_errfmt" + "histreedit" + "nocasematch" + ]; + sessionVariables = { + PROMPT_CHAR = "λ"; + PROMPT_CHAR_COLOR = "cyan"; + PROMPT_CHAR_ROOT = "#"; + PROMPT_CHAR_ROOT_COLOR = "magenta"; + SHORTEN_CWD = 1; + CWD_COLOR = "white"; + EXPAND_TILDE = 0; + GIT_CLEAN = "·"; + GIT_CLEAN_COLOR = "green"; + GIT_WT_MODIFIED = "×"; + GIT_WT_MODIFIED_COLOR = "red"; + GIT_INDEX_MODIFIED = "±"; + GIT_INDEX_MODIFIED_COLOR = "yellow"; + BRANCH_COLOR = "bright black"; + COMMIT_COLOR = "green"; + PF_INFO = "ascii title os kernel uptime pkgs shell "; + PF_SEP = " "; + PF_COL1 = 7; + PF_COL2 = 7; + PF_COL3 = 6; + PF_ALIGN = "9"; + PF_ASCII = "nixos"; + _JAVA_AWT_WM_NONREPARENTING = 1; + TERM = "xterm-256color-italic"; + EDITOR = "nvim"; + MANPAGER = "nvim +Man!"; + GPG_TTY = "\$(tty)"; + }; + initExtra = '' + [ -f $HOME/.github ] && . $HOME/.github + [ -f ~/.bash_aliases ] && . ~/.bash_aliases + [ -f ~/.fzf.bash ] && source ~/.fzf.bash + eval "$(direnv hook bash)" + export PS1='\n$(pista)' + export PATH=$PATH:"$HOME/scripts" + ''; + }; +} -- cgit v1.2.3