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 { |
| 17 | type = lib.attrsOf lib.types.str; |
| 18 | description = "Attrset of extra shell aliases"; |
| 19 | default = { }; |
| 20 | }; |
| 21 | dirHashes = lib.mkOption { |
| 22 | type = lib.attrsOf lib.types.str; |
| 23 | description = "Attrset of ~DIR's"; |
| 24 | default = { }; |
| 25 | }; |
| 26 | }; |
| 27 | |
| 28 | config = lib.mkIf config.chimera.shell.zsh.enable { |
| 29 | programs.zsh = { |
| 30 | enable = true; |
| 31 | enableAutosuggestions = true; |
| 32 | enableCompletion = true; |
| 33 | autocd = true; |
| 34 | defaultKeymap = "emacs"; |
| 35 | |
| 36 | shellAliases = config.chimera.shell.zsh.extraAliases; |
| 37 | |
| 38 | dirHashes = config.chimera.shell.zsh.dirHashes; |
| 39 | |
| 40 | history = { |
| 41 | extended = true; |
| 42 | }; |
| 43 | historySubstringSearch.enable = true; |
| 44 | |
| 45 | oh-my-zsh = { |
| 46 | enable = true; |
| 47 | plugins = [ "git" ]; |
| 48 | }; |
| 49 | }; |
| 50 | }; |
| 51 | } |