blob: 693da7bc9d35a9c3d626984473cfff51ad2b660d [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;
Skyler Grey6b8b30c2024-04-20 22:20:37 +000036 autosuggestion.enable = true;
37 syntaxHighlighting.enable = true;
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050038 enableCompletion = true;
39 autocd = true;
40 defaultKeymap = "emacs";
41
42 shellAliases = config.chimera.shell.zsh.extraAliases;
43
44 dirHashes = config.chimera.shell.zsh.dirHashes;
45
46 history = {
47 extended = true;
48 };
49 historySubstringSearch.enable = true;
50
51 oh-my-zsh = {
52 enable = true;
PineaFan42e4c6c2024-04-20 20:44:58 +010053 plugins = [ "git" ] ++ config.chimera.shell.zsh.ohMyZsh.extraPlugins;
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050054 };
55 };
56 };
57}