dotfiles/nixos/home-manager/programs/zsh.nix

111 lines
2.4 KiB
Nix
Raw Normal View History

2022-12-19 09:09:08 +00:00
{
config,
pkgs,
...
}: {
2021-11-22 19:32:26 +00:00
programs.zsh = {
enable = true;
history = {
size = 102400;
save = 102400;
ignoreDups = true;
expireDuplicatesFirst = true;
share = true;
};
enableAutosuggestions = true;
enableCompletion = true;
oh-my-zsh = {
enable = true;
2022-12-19 09:09:08 +00:00
plugins = ["vi-mode" "git" "python" "history-substring-search" "tmux"];
2021-11-22 19:32:26 +00:00
};
initExtra = ''
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=238'
setopt HIST_IGNORE_ALL_DUPS
'';
profileExtra = ''
export PATH="$HOME/programs:$PATH";
export PATH="$HOME/tools:$PATH";
export PATH="$HOME/bin:$PATH";
export PATH="$HOME/.local/bin:$PATH";
export PATH="$GOPATH/bin:$PATH";
export PATH="$HOME/.rvm/bin:$PATH";
export PATH="$HOME/.cargo/bin:$PATH";
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH";
'';
envExtra = ''
[ -s "/home/cyryl/.jabba/jabba.sh" ] && source "/home/cyryl/.jabba/jabba.sh"
tmux source-file ~/.config/tmux/tmux.conf
local nixos_version=`which nixos-version`
2022-03-10 12:41:38 +00:00
if [[ ! -x "$nixos_version" && ! `uname` == "Darwin" ]]; then
2021-11-22 19:32:26 +00:00
source /home/cyryl/.nix-profile/etc/profile.d/nix.sh
export NIX_PATH="$HOME/.nix-defexpr/channels:$NIX_PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
echo "non-nixos patches loaded"
fi
'';
sessionVariables = {
TERM = "xterm-256color";
EDITOR = "vim";
VISUAL = "vim";
PAGER = "less";
ZSH_TMUX_AUTOSTART = true;
GOPATH = "$HOME/go";
};
shellAliases = {
tmate = "tmux detach-client -E 'tmate;tmux'";
cat = "bat -p";
rg = "rga";
};
};
2019-07-07 11:45:08 +01:00
2021-11-22 19:32:26 +00:00
programs.direnv = {
enable = true;
enableZshIntegration = true;
2022-12-19 09:09:08 +00:00
nix-direnv = {enable = true;};
2021-11-22 19:32:26 +00:00
};
home.file.".config/starship.toml".text = ''
2022-02-27 20:21:31 +00:00
command_timeout = 8192
2021-11-22 19:32:26 +00:00
[aws]
disabled = true
[battery]
full_symbol = ""
charging_symbol = ""
discharging_symbol = ""
[[battery.display]]
threshold = 10
style = "bold red"
[[battery.display]]
threshold = 30
style = "bold yellow"
[memory_usage]
disabled = false
[git_branch]
symbol = "git "
[hg_branch]
symbol = "hg "
[nix_shell]
symbol = "nix-shell "
'';
programs.starship = {
enable = true;
enableZshIntegration = true;
};
2020-07-04 10:21:15 +01:00
}