anchor.diff:  let
   
     cfg = config.programs.zsh;
  +
  +  relToDotDir = file: (optionalString (cfg.dotDir != null) (cfg.dotDir + "/")) + file;
  +
  +  pluginsDir = if cfg.dotDir != null then
  +    relToDotDir "plugins" else ".zsh/plugins";
  +
   
     historyModule = types.submodule {
       options = {
  
positive.code:       envVarsStr = concatStringsSep "\n" (
          mapAttrsToList export config.home.sessionVariables
        );
      in mkIf cfg.enable {
        home.packages = with pkgs; [ zsh ]
          ++ optional cfg.enableCompletion nix-zsh-completions
          ++ optional cfg.oh-my-zsh.enable oh-my-zsh;
  
        home.file.".zshenv".text = ''
          ${optionalString (config.home.sessionVariableSetter == "zsh")
            envVarsStr}
        '';
  
        home.file.".zshrc".text = ''
          ${export "HISTSIZE" cfg.history.size}
          ${export "HISTFILE" cfg.history.path}
  
          setopt HIST_FCNTL_LOCK
          ${if cfg.history.ignoreDups then "setopt" else "unsetopt"} HIST_IGNORE_DUPS
  
negative.code:         ''}
  
          ${concatStrings (map (plugin: ''
            source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}"
          '') cfg.plugins)}
  
          ${cfg.initExtra}
  