nixos/home-manager/modules/shell.nix

97 lines
2.8 KiB
Nix
Raw Normal View History

2024-03-17 13:54:36 +01:00
{ inputs, config, pkgs, ... }: {
# But we all know I love zsh
programs.zsh = {
enable = true;
2024-03-16 18:16:48 +01:00
autosuggestion.enable = true;
enableCompletion = true;
history.path = "${config.xdg.dataHome}/zsh/history";
dotDir = ".config/zsh";
2024-03-23 21:33:36 +01:00
shellAliases = { lg = "lazygit"; };
envExtra = ''
# NNN settings
export NNN_FIFO="/tmp/nnn.fifo"
export NNN_SSHFS="sshfs -o follow_symlinks"
export NNN_TERMINAL="alacritty --class preview,preview"
# Catppuccin colors nnn
BLK="03" CHR="03" DIR="04" EXE="02" REG="07" HARDLINK="05" SYMLINK="05" MISSING="08" ORPHAN="01" FIFO="06" SOCK="03" UNKNOWN="01"
export NNN_COLORS="#04020301;4231"
export NNN_FCOLORS="$BLK$CHR$DIR$EXE$REG$HARDLINK$SYMLINK$MISSING$ORPHAN$FIFO$SOCK$UNKNOWN"
2024-03-16 19:03:53 +01:00
'';
initExtra = ''
# VI Mode escape timeout fix
export KEYTIMEOUT=1
2024-03-16 19:03:53 +01:00
# Substring search settings
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=blue,fg=black,bold"
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=black,bold'
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
2024-03-16 19:03:53 +01:00
'';
initExtraFirst = ''
nitch
2024-03-16 19:03:53 +01:00
'';
zplug = {
enable = true;
plugins = [
{ name = "zap-zsh/supercharge"; }
2024-03-16 19:03:53 +01:00
{ name = "zap-zsh/completions"; }
{ name = "zap-zsh/vim"; }
{ name = "chivalryq/git-alias"; }
{ name = "zdharma-continuum/fast-syntax-highlighting"; }
{ name = "MichaelAquilina/zsh-you-should-use"; }
{ name = "zsh-users/zsh-history-substring-search"; }
];
};
};
# Eza settings
programs.eza = {
enable = true;
2024-03-16 17:50:13 +01:00
enableZshIntegration = true;
git = true;
icons = true;
};
# Zoxide settings
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
# Starhip settings
2024-03-17 13:54:36 +01:00
programs.starship = let flavour = "frappe";
in {
enable = true;
enableZshIntegration = true;
2024-03-17 13:54:36 +01:00
settings = {
palette = "catppuccin_${flavour}";
add_newline = false;
} // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub {
owner = "starship";
repo = "starship";
rev = "698572aa575508a4bdd0d3092c97f5a056dc50eb";
hash = "sha256-jrtlK4vN8u2UhKeo5+9IyCVYJxkySh+JKhSCUsnQWAg=";
} + /docs/public/presets/toml/pure-preset.toml)) // builtins.fromTOML
(builtins.readFile (pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "starship";
rev = "5629d2356f62a9f2f8efad3ff37476c19969bd4f";
hash = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0=";
} + /palettes/${flavour}.toml));
};
# Fzf settings
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
2024-03-17 17:38:16 +01:00
# Enable direnv
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
}