1{ lib, config, pkgs, ... }:
2
3with lib;
4let
5 cfg = config.modules.shell;
6in {
7 options.modules.shell = {
8 enable = mkOption {
9 default = true;
10 description = "Shell";
11 type = types.bool;
12 };
13 };
14
15 config = mkIf cfg.enable {
16 programs.zsh = rec {
17 enable = true;
18 enableCompletion = true;
19 enableVteIntegration = true;
20 autosuggestion.enable = true;
21 syntaxHighlighting.enable = true;
22 dotDir = "${config.xdg.configHome}/zsh";
23 shellAliases = {
24 ls = "ls --color=auto";
25 ll = "ls -l";
26 http = "xh";
27 };
28 history = {
29 append = true;
30 expireDuplicatesFirst = true;
31 path = "${config.xdg.stateHome}/zsh/zsh_history";
32 };
33 sessionVariables = {
34 KEYTIMEOUT = "1";
35 VIM_MODE_TRACK_KEYMAP = "no";
36 MODE_INDICATOR = "";
37 PURE_GIT_PULL = "0";
38 PURE_PROMPT_SYMBOL = "➜";
39 PURE_PROMPT_VICMD_SYMBOL = "➜";
40 PURE_GIT_UP_ARROW = " ";
41 PURE_GIT_DOWN_ARROW = " ";
42 PURE_GIT_STASH_SYMBOL = " ";
43 ZDOTDIR = "${config.xdg.configHome}/zsh";
44 };
45 plugins = [
46 {
47 name = "pure-prompt";
48 file = "share/zsh/site-functions/async";
49 src = pkgs.pure-prompt;
50 }
51 {
52 name = "pure-prompt";
53 file = "share/zsh/site-functions/prompt_pure_setup";
54 src = pkgs.pure-prompt;
55 }
56 ];
57 initContent = /*sh*/''
58 setopt NO_NOMATCH
59 stty -ixon -ixoff
60 '';
61 };
62
63 programs.direnv = {
64 enable = true;
65 enableZshIntegration = true;
66 nix-direnv.enable = true;
67 };
68
69 programs.zoxide = {
70 enable = true;
71 enableZshIntegration = true;
72 enableNushellIntegration = mkDefault false;
73 enableFishIntegration = mkDefault false;
74 };
75 };
76}