inputs: { config, lib, pkgs, ... }: let inherit (inputs.self.lib.theme) fgEscapeCode; dominantEscapeCode = fgEscapeCode config.theme.colors.dominant; in { programs.zsh = { enable = true; interactiveShellInit = lib.mkBefore '' # Use cache file as is, to speed-up start time # This does mean we have to run once in a while: # compinit -d .config/zsh/.zcompdump autoload -U compinit && compinit -C source "${pkgs.zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh" function () { local dominant_escape_code="${dominantEscapeCode}" local dim_fg_escape_code="${fgEscapeCode config.theme.colors.dimForeground}" ${builtins.readFile ../../dotfiles/zshrc} } ''; # not needed, since we're using starship promptInit = ""; # Use cache file as is, to speed-up start time # This does mean we have to run once in a while: # compinit -d .config/zsh/.zcompdump enableGlobalCompInit = false; syntaxHighlighting = { enable = true; highlighters = [ "main" "brackets" "line" ]; }; shellAliases = { e = "\${(z)EDITOR}"; # Space at the end makes Zsh expand aliases after "sudo" sudo = "sudo "; }; setOptions = [ "NO_CASE_GLOB" "NO_CLOBBER" ]; }; users.defaultUserShell = pkgs.zsh; home-manager.sharedModules = [ ( { config, ... }: { programs.zsh = { enable = true; # Completion is already handled by the GRML conf enableCompletion = false; history = { extended = true; expireDuplicatesFirst = true; ignoreDups = true; ignorePatterns = [ "run-help *" ]; # different, for expireDuplicatesFirst size = 1100; save = 1000; }; # XDG dotDir = ".config/zsh"; history.path = "${config.xdg.dataHome}/zsh/zsh_history"; }; } ) ]; }