mio-ops/profiles/zsh.nix

38 lines
980 B
Nix
Raw Normal View History

2021-03-04 10:48:18 +00:00
# Configuration common to all my servers
{
2022-03-07 14:26:15 +00:00
config,
pkgs,
lib,
...
}: {
2021-03-04 10:48:18 +00:00
# Program defaults for all hosts
programs.zsh = {
2021-11-16 04:57:23 +00:00
enable = true; # Also enables & installs nix-zsh-completions
2021-03-04 10:48:18 +00:00
autosuggestions.enable = true;
interactiveShellInit = ''
export TERM="xterm-256color"
eval "$(direnv hook zsh)"
test -r ~/.dir_colors && eval $(dircolors ~/.dir_colors)
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
2021-06-07 04:36:32 +00:00
if type rg &> /dev/null; then
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_DEFAULT_OPTS='-m --height 50% --border'
fi
2021-03-04 10:48:18 +00:00
'';
ohMyZsh = {
enable = true;
2022-03-07 14:26:15 +00:00
plugins = ["fzf" "git"];
2021-03-04 10:48:18 +00:00
};
promptInit = ''
eval "$(starship init zsh)"
'';
2021-07-12 23:44:14 +00:00
vteIntegration = true;
2021-03-04 10:48:18 +00:00
};
2022-03-07 14:26:15 +00:00
environment.systemPackages = with pkgs; [fzf];
2021-06-07 04:36:32 +00:00
2021-11-16 04:57:23 +00:00
users.defaultUserShell = pkgs.zsh; # Set the default shell for all users
2021-03-04 10:48:18 +00:00
}