dotfiles/nixos/programs/zsh.nix

66 lines
1.9 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" ];
};
plugins = [
{
name = "spaceship";
file = "spaceship.zsh";
src = pkgs.fetchgit {
url = "https://github.com/denysdovhan/spaceship-prompt";
rev = "v3.11.1";
sha256 = "0habry3r6wfbd9xbhw10qfdar3h5chjffr5pib4bx7j4iqcl8lw8";
};
}];
2019-07-07 11:45:08 +01:00
initExtra = ''
SPACESHIP_TIME_SHOW=true
SPACESHIP_EXIT_CODE_SHOW=true
SPACESHIP_VI_MODE_SHOW=false
SPACESHIP_BATTERY_THRESHOLD=30
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
2019-10-10 21:32:21 +01:00
'';
2019-07-07 11:45:08 +01:00
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";
2019-10-10 21:32:21 +01:00
'';
2019-11-24 10:33:17 +00:00
envExtra = ''
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"
echo "non-nixos patches loaded"
fi
'';
2019-10-10 21:32:21 +01:00
sessionVariables = {
TERM="xterm-256color";
2019-07-07 11:45:08 +01:00
EDITOR="vim";
VISUAL="vim";
PAGER="less";
ZSH_TMUX_AUTOSTART=true;
GOPATH="$HOME/go";
};
2019-11-24 10:48:34 +00:00
shellAliases = { tmate = "tmux detach-client -E 'tmate;tmux'"; cat = "bat -p"; };
2019-07-07 11:45:08 +01:00
};
}