/
default.nix
75 lines (62 loc) · 1.79 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ pkgs, ... }:
let
extras = [
./elm.zsh
./find-and-edit.zsh
./flixify.sh
./git.zsh
./jetpack.zsh
./jump.zsh
./nix.zsh
./nixify.sh
./root.zsh
./rubofix.zsh
./scripts.zsh
./search.zsh
];
extraInitExtra =
builtins.foldl' (soFar: new: soFar + "\n" + builtins.readFile new) ""
extras;
in
{
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
enableAutosuggestions = true;
enableCompletion = true;
plugins = [
{
name = "fzf-tab";
src = pkgs.fzf-tab;
}
];
initExtra =
''
EDITOR=hx
export EDITOR
alias ready='gh pr create --reviewer NoRedInk/team-kraken'
# see `man zshoptions`
setopt PROMPT_SUBST # do parameter, command, and arithmetic expansion in prompts
setopt PROMPT_SP # preserve partial lines, adding inverse-colored % after a line
EMOJI_NEUTRAL=(😃 🤓 👾 🤖 💯 🐵 🦍 🐺 🐈 🦄 🦅 🦉 🐬 🐋 🐙 🌲 🌳 🍀 🍁 🍇 🍍 🍩 🌍 🌎 🌏 🚄 🚍 🚲 🛴 🚡 🚠 🚀)
EMOJI_UNHAPPY=(😵 😲 🤡 👹 😿 💔 💢)
EMOJI_PROMPT="''${EMOJI_NEUTRAL[$RANDOM % ''${#EMOJI_NEUTRAL[@]}]}"
EMOJI_PROMPT_ERROR="''${EMOJI_UNHAPPY[$RANDOM % ''${#EMOJI_UNHAPPY[@]}]}"
PROMPT="%(?.$EMOJI_PROMPT .$EMOJI_PROMPT_ERROR [%F{red}%?%f] )%B%F{blue}%c%f%b %F{blue}»%f "
RPROMPT=
# 1password plugins
alias gh="op plugin run -- gh"
# grab Homebrew binaries if needed
if test -d /opt/homebrew/bin; then
export PATH="$PATH:/opt/homebrew/bin"
fi
''
+ extraInitExtra;
history = {
save = 10000;
size = 10000;
share = true;
};
};
home.packages = [ pkgs.kak-session pkgs.mand ];
}