mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Switch shell to zsh
This commit is contained in:
parent
a96014bee2
commit
c98192eb68
8 changed files with 1795 additions and 63 deletions
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue