aboutsummaryrefslogtreecommitdiffstats
path: root/modules/tools/zsh/default.nix
blob: 0fed3801a25debb136c0fa93ca37dca6b27f6e15 (plain)
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
{ config, lib, ... }:

{
  options.tools.zsh = {
    enable = lib.mkEnableOption "Enables zsh.";
  };
  
  config = lib.mkIf config.tools.zsh.enable {
    programs.zsh = {
      enable = true;
      dotDir = "${config.xdg.configHome}/zsh";
      history.path = "${config.xdg.cacheHome}/zsh/history";
      initContent = ''
        setopt PROMPT_SUBST

        autoload -U colors && colors

        bindkey "^[[3~" delete-char
        bindkey "^?" backward-delete-char
      '';
    };

    home.sessionVariables.SHELL = "${config.programs.zsh.package}/bin/zsh";
  };
}