blob: b2491c935a603b9b9b73a93e003ba2bd3c593c67 [file] [log] [blame]
Samuel Shuert02ffd1e2024-02-13 21:37:15 -05001{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7{
8
9 options.chimera.shell.zsh = {
10 enable = lib.mkEnableOption "Enable ZSH Shell";
11 default = lib.mkOption {
12 type = lib.types.bool;
13 description = "Set as default shell";
14 default = true;
15 };
16 extraAliases = lib.mkOption {
Samuel Shuertb24d7632024-02-20 20:51:09 +000017 type = lib.types.attrsOf lib.types.str;
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050018 description = "Attrset of extra shell aliases";
19 default = { };
20 };
21 dirHashes = lib.mkOption {
Samuel Shuertb24d7632024-02-20 20:51:09 +000022 type = lib.types.attrsOf lib.types.str;
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050023 description = "Attrset of ~DIR's";
24 default = { };
25 };
PineaFan42e4c6c2024-04-20 20:44:58 +010026 ohMyZsh.extraPlugins = lib.mkOption {
27 type = lib.types.listOf lib.types.str;
28 description = "List of plugins as strs";
29 default = [ ];
30 };
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050031 };
32
33 config = lib.mkIf config.chimera.shell.zsh.enable {
34 programs.zsh = {
35 enable = true;
36 enableAutosuggestions = true;
37 enableCompletion = true;
38 autocd = true;
39 defaultKeymap = "emacs";
40
41 shellAliases = config.chimera.shell.zsh.extraAliases;
42
43 dirHashes = config.chimera.shell.zsh.dirHashes;
44
45 history = {
46 extended = true;
47 };
48 historySubstringSearch.enable = true;
49
50 oh-my-zsh = {
51 enable = true;
PineaFan42e4c6c2024-04-20 20:44:58 +010052 plugins = [ "git" ] ++ config.chimera.shell.zsh.ohMyZsh.extraPlugins;
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050053 };
54 };
55 };
56}