Files
bankrupt/home-manager/modules/shells.nix
T
2026-01-18 23:17:17 +08:00

103 lines
2.0 KiB
Nix

# Shell configuration (bash, zsh, fish) with integrations
{
inputs,
lib,
config,
pkgs,
...
}: {
# Bash configuration
programs.bash = {
enable = true;
enableCompletion = true;
shellAliases = {
ll = "ls -la";
".." = "cd ..";
"..." = "cd ../..";
gs = "git status";
gd = "git diff";
};
};
# Zsh configuration
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -la";
".." = "cd ..";
"..." = "cd ../..";
gs = "git status";
gd = "git diff";
nix-gc = "nix-collect-garbage -d";
};
history = {
size = 10000;
path = "${config.home.homeDirectory}/.zsh_history";
};
initContent = ''
# Custom prompt or additional configuration
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_REDUCE_BLANKS
'';
};
# Fish configuration is in ./fish.nix
# Starship prompt (works with all shells)
programs.starship = {
enable = true;
settings = {
add_newline = true;
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
};
package.disabled = true;
};
};
# Zoxide (better cd)
programs.zoxide = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
# fzf (fuzzy finder)
programs.fzf = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = false; # Using PatrickF1/fzf.fish plugin instead
};
# Eza (modern ls replacement)
programs.eza = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
git = true;
icons = "auto";
};
# Bat (better cat)
programs.bat = {
enable = true;
config = {
theme = "TwoDark";
pager = "less -FR";
};
};
}