nixos-config/modules/home/shell/default.nix

49 lines
1.1 KiB
Nix

{ config, lib, ... }:
{
imports = [
./p10k
./aliases.nix
];
options.myConfig.shell = {
enable = lib.mkEnableOption "";
};
config = {
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
autocd = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history = {
ignoreAllDups = true;
path = "${config.xdg.dataHome}/zsh/zsh_history";
};
initExtraFirst = ''
(( ''${+commands[direnv]} )) && emulate zsh -c "$(direnv export zsh)"
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
(( ''${+commands[direnv]} )) && emulate zsh -c "$(direnv hook zsh)"
'';
};
programs.fzf.enable = true;
programs.zoxide = {
enable = true;
options = [ "--cmd cd" ];
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
config.global.hide_env_diff = true;
};
};
}