{ config, pkgs, lib, ... }: let cfg = config.my.home.zsh; in { options.my.home.zsh = with lib; { enable = mkEnableOption "zsh configuration"; }; config = lib.mkIf cfg.enable { home.packages = with pkgs; [ zsh-completions ]; programs.zsh = { enable = true; dotDir = ".config/zsh"; enableCompletion = true; history = { size = 500000; save = 500000; extended = false; ignoreSpace = true; ignoreDups = true; share = false; path = "${config.xdg.dataHome}/zsh/zsh_history"; }; localVariables = { # Print timing statistics for everything which takes longer than 5 seconds of # user + system time. REPORTTIME = 5; }; defaultKeymap = "emacs"; initExtra = lib.concatMapStrings builtins.readFile [ ./completion-style.zsh ./options.zsh ./prompt.zsh ]; }; programs.dircolors = { enable = true; }; }; }