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; |
| 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; |
PineaFan | 42e4c6c | 2024-04-20 20:44:58 +0100 | [diff] [blame] | 52 | plugins = [ "git" ] ++ config.chimera.shell.zsh.ohMyZsh.extraPlugins; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 53 | }; |
| 54 | }; |
| 55 | }; |
| 56 | } |