NixOS/modules/shell/tools.nix
2024-06-07 17:07:21 -06:00

87 lines
2.3 KiB
Nix

{
config,
lib,
pkgs,
...
}:
{
options.my.shell.tools.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.shell.tools.enable {
home-manager.users.jawz.programs = {
bash = {
initExtra = ''
if command -v fzf-share >/dev/null; then
source "$(fzf-share)/key-bindings.bash"
source "$(fzf-share)/completion.bash"
fi
'';
shellAliases = {
cd = "z";
hh = "hstr";
ls = "eza --icons --group-directories-first";
rm = "trash";
b = "bat";
f = "fzf --multi --exact -i";
unique-extensions = ''
fd -tf | rev | cut -d. -f1 | rev |
tr '[:upper:]' '[:lower:]' | sort |
uniq --count | sort -rn'';
};
};
xdg.configFile = {
"htop/htoprc".source = ../dotfiles/htop/htoprc;
};
hstr.enable = true;
htop = {
enable = true;
package = pkgs.htop-vim;
};
zoxide = {
enable = true;
enableBashIntegration = true;
};
bat = {
enable = true;
config = {
pager = "less -FR";
theme = "base16";
};
extraPackages = with pkgs.bat-extras; [
batman # man pages
batpipe # piping
batgrep # ripgrep
batdiff # this is getting crazy!
batwatch # probably my next best friend
prettybat # trans your sourcecode!
];
};
};
programs = {
starship.enable = true;
tmux.enable = true;
fzf.fuzzyCompletion = true;
neovim = {
enable = true;
vimAlias = true;
};
};
users.users.jawz.packages = with pkgs; [
ripgrep # modern grep
du-dust # rusty du similar to gdu
eza # like ls but with colors
fd # modern find, faster searches
fzf # fuzzy finder! super cool and useful
gdu # disk-space utility checker, somewhat useful
rmlint # amazing dupe finder that integrates well with BTRFS
tldr # man for retards
trash-cli # oop! did not meant to delete that
jq # linting
];
};
environment.variables = {
HISTFILE = "${XDG_STATE_HOME}/bash/history";
LESSHISTFILE = "-";
RIPGREP_CONFIG_PATH = "${XDG_CONFIG_HOME}/ripgrep/ripgreprc";
};
}