inputs: { config, lib, pkgs, ... }: with import ../../lib/theme.nix { inherit lib; }; let dominantEscapeCode = fgEscapeCode config.theme.colors.dominant; in { programs.zsh = { enable = true; interactiveShellInit = with lib; '' source "${pkgs.grml-zsh-config}/etc/zsh/zshrc" is4 && xsource "${pkgs.grml-zsh-config}/etc/zsh/keephack" 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} } # Grml's ZSH config overrides less variables export ${concatStringsSep " " (mapAttrsToList (variable: value: "${variable}=\"${value}\"") config.programs.less.envVariables)} ''; # otherwise it'll override the grml prompt promptInit = ""; # Grml handles that, and supports cache (faster!!!) enableGlobalCompInit = false; syntaxHighlighting = { enable = true; highlighters = [ "main" "brackets" "line" ]; }; shellAliases = { e = "\${(z)EDITOR}"; }; setOptions = [ "HIST_IGNORE_DUPS" "SHARE_HISTORY" "HIST_FCNTL_LOCK" "NO_CLOBBER" "NO_CASE_GLOB" ]; }; users.defaultUserShell = pkgs.zsh; home-manager.users.minijackson = { ... }: { # Allows zsh config from home-manager programs.zsh = { enable = true; # Completion is already handled by the GRML conf enableCompletion = false; }; }; home-manager.users.root = { ... }: { programs.zsh = lib.mkDefault config.home-manager.users.minijackson.programs.zsh; }; }