Skip to content

Commit

Permalink
zsh->bash
Browse files Browse the repository at this point in the history
  • Loading branch information
MobSenpai committed Aug 15, 2023
1 parent eb6a2c1 commit debc36c
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 242 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ NixOS / Home-Manager / Flake
| Terminal | [Alacritty](https://github.com/alacritty/alacritty) |
| Editor | [Neovim](https://github.com/neovim/neovim) + [Vscodium](https://github.com/VSCodium/vscodium) |
| File Manager | [Pcmanfm](https://github.com/lxde/pcmanfm) |
| Shell | [Zsh](https://www.zsh.org/) |
| Shell | [Bash](https://www.gnu.org/software/bash/) |

<br>
<br>
Expand Down
78 changes: 78 additions & 0 deletions home/yashraj/modules/shell/bash.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.colorscheme) colors;
in {
programs.bash = {
enable = true;

initExtra = ''
bind "set completion-ignore-case on"
# shopt
shopt -s autocd # change to named directory
shopt -s cdspell # autocorrects cd misspellings
shopt -s cmdhist # save multi-line commands in history as single line
shopt -s dotglob
shopt -s histappend # do not overwrite history
shopt -s expand_aliases # expand aliases
# ex = EXtractor for all kinds of archives
# usage: ex <file>
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) tar xf $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# reporting tools - install when not installed
neofetch
'';

shellAliases = with pkgs; {
cleanup = "sudo nix-collect-garbage --delete-older-than 7d";
bloat = "nix path-info -Sh /run/current-system";
v = "nvim";
g = "git";
commit = "git add . && git commit -m";
push = "git push";
pull = "git pull";
m = "mkdir -p";
fcd = "cd $(find -type d | fzf)";
grep = lib.getExe ripgrep;
du = lib.getExe du-dust;
ps = lib.getExe procs;
rm = lib.getExe trash-cli;
cat = "${lib.getExe bat} --style=plain";
l = "${lib.getExe exa} -lF --time-style=long-iso --icons";
la = "${lib.getExe exa} -lah --tree";
ls = "${lib.getExe exa} -h --git --icons --color=auto --group-directories-first -s extension";
tree = "${lib.getExe exa} --tree --icons --tree";
ytmp3 = ''
${lib.getExe yt-dlp} -x --continue --add-metadata --embed-thumbnail --audio-format mp3 --audio-quality 0 --metadata-from-title="%(artist)s - %(title)s" --prefer-ffmpeg -o "%(title)s.%(ext)s"
'';
};
};
}
6 changes: 3 additions & 3 deletions home/yashraj/modules/shell/cli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@

fzf = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
};

zoxide = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
};

dircolors = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
};
};
}
2 changes: 1 addition & 1 deletion home/yashraj/modules/shell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}: {
imports = [
./xdg.nix
./zsh.nix
./bash.nix
./starship.nix
./cli.nix
./git.nix
Expand Down
7 changes: 4 additions & 3 deletions home/yashraj/modules/shell/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
inherit
(pkgs)
alejandra
any-nix-shell
# any-nix-shell

# deadnix

nix-index
Expand All @@ -25,12 +26,12 @@
programs = {
nix-index = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
};

direnv = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
};
Expand Down
2 changes: 1 addition & 1 deletion home/yashraj/modules/shell/starship.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

programs.starship = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
settings = {
scan_timeout = 10;

Expand Down
228 changes: 0 additions & 228 deletions home/yashraj/modules/shell/zsh.nix

This file was deleted.

Loading

0 comments on commit debc36c

Please sign in to comment.