Switch shell to zsh

This commit is contained in:
SebastianStork 2024-05-21 08:57:19 +02:00
parent a96014bee2
commit c98192eb68
8 changed files with 1795 additions and 63 deletions

View file

@ -1,20 +1,49 @@
{ config, lib, ... }:
let
cfg = config.myConfig.shell;
in
{
imports = [
./starship.nix
./enhancement.nix
./p10k
./aliases.nix
];
options.myConfig.shell = {
bash.enable = lib.mkEnableOption "";
zsh.enable = lib.mkEnableOption "";
enable = lib.mkEnableOption "";
};
config = {
programs.bash.enable = cfg.bash.enable;
programs.zsh.enable = cfg.zsh.enable;
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;
};
};
}