blob: 650948a0c5fd2a61cefd1dd11d4503352f952096 [file] [log] [blame]
Skyler Turner0ab3b7f2022-03-04 23:24:10 +00001{ config, ... }: {
Skyler Turner62330c12022-03-04 22:10:16 +00002 programs.zsh = {
3 enable = true;
4 oh-my-zsh = {
5 enable = true;
6 plugins = [ "git" ];
7 theme = "crunch";
8 };
9 history = {
10 size = 10000;
11 path = "${config.xdg.dataHome}/zsh/history";
12 expireDuplicatesFirst = true;
13 extended = true;
14 };
15 initExtra = ''
16 bindkey "\'\'$\{key[Up]}" up-line-or-search
17
18 command_not_found_handler ()
19 {
20 local p='/nix/store/ycclzpk99snlrk8sg9n4j8pm1927gavw-command-not-found/bin/command-not-found';
21 if [ -x "$p" ] && [ -f '/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' ]; then
22 "$p" "$@" 2>&1 | sed -r 's/nix-shell -p (\S+)/nix shell nixpkgs#\1/g' 1>&2;
23 if [ $? = 126 ]; then
24 "$@";
25 else
26 return 127;
27 fi;
28 else
29 echo "$1: command not found" 1>&2;
30 return 127;
31 fi
32 }
33 '';
34 enableSyntaxHighlighting = true;
35 enableAutosuggestions = true;
36 autocd = true;
37 dotDir = ".local/share/zsh";
38 };
39}