about summary refs log tree commit diff
path: root/home/zsh/default.nix
blob: cc195799f2fe79cfad6a262964d8b5982246b465 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ 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; };
  };
}