From d8671b910f2526619626022b964fdf1ac4fbcf8f Mon Sep 17 00:00:00 2001 From: devhell Date: Mon, 23 Nov 2020 18:52:07 +0000 Subject: profiles/base: Rework ZSH configuration I've been trying to get most of my environment directly configured via my NixOS configuration rather than rely on my dotfiles repository, if the program/configuration is well supported in NixOS. Just like Vim, here too I'm relying more on NixOS' ZSH options, which truly eliminates dependencies on external repositories or dotfile setups. --- modules/user/devhell/profiles/base.nix | 38 ++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'modules/user') diff --git a/modules/user/devhell/profiles/base.nix b/modules/user/devhell/profiles/base.nix index 0932f7bc..11fec531 100644 --- a/modules/user/devhell/profiles/base.nix +++ b/modules/user/devhell/profiles/base.nix @@ -66,7 +66,28 @@ in { }; zsh = { enable = true; - enableCompletion = true; + promptInit = '' + eval "$(${pkgs.starship}/bin/starship init zsh)" + ''; + interactiveShellInit = '' + zstyle ':completion:*' menu select + source ${pkgs.fzf}/share/fzf/key-bindings.zsh + ''; + shellAliases = { + ls = "ls --color=auto"; + grep = "grep --color=auto"; + diff = "diff --color=auto"; + ip = "ip --color=auto"; + }; + setOptions = [ + "auto_cd" + "auto_pushd" + "correct" + "hist_fcntl_lock" + "hist_ignore_dups" + "hist_no_store" + "hist_reduce_blanks" + ]; }; bash = { enableCompletion = true; @@ -92,7 +113,20 @@ in { }; environment = { - shells = [ "/run/current-system/sw/bin/zsh" ]; + shellInit = '' + export GPG_AGENT_INFO=$HOME/.gnupg/S.gpg-agent + export LIBVIRT_DEFAULT_URI=qemu:///system + export LS_COLORS="$(vivid generate snazzy)" + export LESS_TERMCAP_mb=$'\E[1;31m' + export LESS_TERMCAP_md=$'\E[1;36m' + export LESS_TERMCAP_me=$'\E[0m' + export LESS_TERMCAP_so=$'\E[01;33m' + export LESS_TERMCAP_se=$'\E[0m' + export LESS_TERMCAP_us=$'\E[1;32m' + export LESS_TERMCAP_ue=$'\E[0m' + export EDITOR='vim' + ''; + shells = [ pkgs.zsh ]; }; fonts = { -- cgit 1.4.1