-
Notifications
You must be signed in to change notification settings - Fork 10
/
shell.nix
159 lines (143 loc) Β· 3.94 KB
/
shell.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
_:
let
shellAliases = {
# Apps... but better
git = "hub";
v = "lvim";
vim = "lvim";
ls = "eza";
cat = "bat";
find = "fd";
# ls
l = "ls -l";
ll = "ls -la";
# misc
e = "emacs";
oo = "open .";
tree = "eza --tree";
reload = "exec fish";
inflate = ''ruby -r zlib -e "STDOUT.write Zlib::Inflate.inflate(STDIN.read)"'';
dark = "osascript -e 'tell application \"System Events\" to tell appearance preferences to set dark mode to not dark mode'";
};
shellAbbrs = {
gs = "git status -sb";
ga = "git add";
gc = "git commit";
gcm = "git commit -m";
gca = "git commit --amend";
gcl = "git clone";
gco = "git checkout";
gp = "git push";
gpl = "git pull";
gl = "git l";
gd = "git diff";
gds = "git diff --staged";
gr = "git rebase -i HEAD~15";
gf = "git fetch";
gfc = "git findcommit";
gfm = "git findmessage";
gui = "gitui";
gsu = "git branch --set-upstream-to=origin/(git rev-parse --abbrev-ref HEAD)";
};
in
{
programs.atuin = {
enable = true;
flags = [ "--disable-up-arrow" ];
};
programs.zoxide = {
enable = true;
options = [ "--cmd j" ];
};
programs.mise = {
enable = true;
globalConfig.tools = {
node = "lts";
usage = "latest";
};
};
programs.starship = {
enable = true;
settings = {
format = "$battery$username$hostname$directory$git_branch$git_status$git_state$cmd_duration$line_break$character";
directory.read_only = " ο ½";
battery = {
full_symbol = "β’";
charging_symbol = "β‘";
discharging_symbol = "β£";
};
git_branch = {
format = "([$branch]($style) )";
style = "bright-black";
};
git_status = {
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](bright-black)($ahead_behind$stashed)]($style) ";
style = "cyan";
conflicted = "β";
untracked = "β";
modified = "β";
staged = "β";
renamed = "β";
deleted = "β";
stashed = "β‘";
};
git_state = {
format = "([$state( $progress_current/$progress_total)]($style) )";
style = "bright-black";
};
cmd_duration = {
format = "[$duration]($style) ";
style = "yellow";
};
};
};
programs.fish = {
inherit shellAliases shellAbbrs;
enable = true;
shellInit = ''
# Set editor
set -x EDITOR lvim
# Configure PNPM
set -gx PNPM_HOME "/Users/matchai/Library/pnpm"
set -gx PATH "$PNPM_HOME" $PATH
# Set fish syntax highlighting
set -g fish_color_autosuggestion '555' 'brblack'
set -g fish_color_cancel -r
set -g fish_color_command --bold
set -g fish_color_comment red
set -g fish_color_cwd green
set -g fish_color_cwd_root red
set -g fish_color_end brmagenta
set -g fish_color_error brred
set -g fish_color_escape 'bryellow' '--bold'
set -g fish_color_history_current --bold
set -g fish_color_host normal
set -g fish_color_match --background=brblue
set -g fish_color_normal normal
set -g fish_color_operator bryellow
set -g fish_color_param cyan
set -g fish_color_quote yellow
set -g fish_color_redirection brblue
set -g fish_color_search_match 'bryellow' '--background=brblack'
set -g fish_color_selection 'white' '--bold' '--background=brblack'
set -g fish_color_user brgreen
set -g fish_color_valid_path --underline
'';
interactiveShellInit = ''
# Initialize homebrew
eval (/opt/homebrew/bin/brew shellenv)
'';
functions = {
idea = ''open -a "IntelliJ IDEA.app" $argv'';
fish_greeting = "";
};
};
programs.zsh = {
inherit shellAliases;
enable = true;
autosuggestion.enable = true;
enableCompletion = true;
history.extended = true;
};
home.file.".hushlogin".text = "";
}