dotfiles/nixos/programs/zsh.nix

94 lines
2.3 KiB
Nix
Raw Normal View History

2019-07-07 11:45:08 +01:00
{ config, pkgs, ... }:
{
2019-10-10 21:32:21 +01:00
programs.zsh = {
enable = true;
history = {
size = 102400;
save = 102400;
ignoreDups = true;
expireDuplicatesFirst = true;
share = true;
};
enableAutosuggestions = true;
enableCompletion = true;
oh-my-zsh = {
2019-07-07 11:45:08 +01:00
enable = true;
2019-10-10 21:32:21 +01:00
plugins = [ "vi-mode" "git" "python" "history-substring-search" "tmux" ];
};
2020-07-04 10:21:15 +01:00
initExtra = ''
2019-08-16 16:38:13 +01:00
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=238'
2019-07-07 11:45:08 +01:00
setopt HIST_IGNORE_ALL_DUPS
2020-07-04 10:21:15 +01:00
'';
profileExtra = ''
2019-07-07 11:45:08 +01:00
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";
2020-07-04 10:21:15 +01:00
'';
envExtra = ''
2019-12-12 12:18:01 +00:00
[ -s "/home/cyryl/.jabba/jabba.sh" ] && source "/home/cyryl/.jabba/jabba.sh"
2019-11-24 10:41:54 +00:00
local nixos_version=`which nixos-version`
2019-11-24 10:45:04 +00:00
if [[ ! -x "$nixos_version" ]]; then
2019-11-24 10:33:17 +00:00
source /home/cyryl/.nix-profile/etc/profile.d/nix.sh
export NIX_PATH="$HOME/.nix-defexpr/channels:$NIX_PATH"
2020-01-03 10:34:49 +00:00
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
2019-11-24 10:33:17 +00:00
echo "non-nixos patches loaded"
fi
2020-07-04 10:21:15 +01:00
'';
sessionVariables = {
TERM="xterm-256color";
EDITOR="vim";
VISUAL="vim";
PAGER="less";
ZSH_TMUX_AUTOSTART=true;
GOPATH="$HOME/go";
2019-07-07 11:45:08 +01:00
};
2020-07-04 10:21:15 +01:00
shellAliases = { tmate = "tmux detach-client -E 'tmate;tmux'"; cat = "bat -p"; };
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
};
home.file.".config/starship.toml".text =''
[aws]
disabled = true
2020-07-04 10:25:32 +01:00
[battery]
full_symbol = ""
charging_symbol = ""
discharging_symbol = ""
2020-07-04 10:21:15 +01:00
[[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;
};
}