Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 1 | { |
| 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 Shuert | b24d763 | 2024-02-20 20:51:09 +0000 | [diff] [blame] | 17 | type = lib.types.attrsOf lib.types.str; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 18 | description = "Attrset of extra shell aliases"; |
| 19 | default = { }; |
| 20 | }; |
| 21 | dirHashes = lib.mkOption { |
Samuel Shuert | b24d763 | 2024-02-20 20:51:09 +0000 | [diff] [blame] | 22 | type = lib.types.attrsOf lib.types.str; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 23 | description = "Attrset of ~DIR's"; |
| 24 | default = { }; |
| 25 | }; |
PineaFan | 42e4c6c | 2024-04-20 20:44:58 +0100 | [diff] [blame] | 26 | ohMyZsh.extraPlugins = lib.mkOption { |
| 27 | type = lib.types.listOf lib.types.str; |
| 28 | description = "List of plugins as strs"; |
| 29 | default = [ ]; |
| 30 | }; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | config = lib.mkIf config.chimera.shell.zsh.enable { |
| 34 | programs.zsh = { |
| 35 | enable = true; |
Skyler Grey | 6b8b30c | 2024-04-20 22:20:37 +0000 | [diff] [blame] | 36 | autosuggestion.enable = true; |
| 37 | syntaxHighlighting.enable = true; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 38 | 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; |
PineaFan | 42e4c6c | 2024-04-20 20:44:58 +0100 | [diff] [blame] | 53 | plugins = [ "git" ] ++ config.chimera.shell.zsh.ohMyZsh.extraPlugins; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 54 | }; |
| 55 | }; |
| 56 | }; |
| 57 | } |