-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
419 lines (383 loc) · 11.5 KB
/
home.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
{ pkgs, ... }:
{
home = rec {
username = "rockboynton";
homeDirectory = "/home/${username}";
stateVersion = "23.11";
packages = with pkgs; [
bat
bottom
direnv
dust
neofetch
neovim
nerdfonts
nix-direnv
fd
fish
fzf
helix
jq
lsd
nix-output-monitor
ripgrep
tree
starship
tealdeer
thefuck
tokei
unzip
usbutils
wezterm
which
zip
zellij
zoxide
zsh
];
};
programs = {
home-manager.enable = true;
helix = {
enable = true;
defaultEditor = true;
settings = {
theme = "gruvbox";
editor = {
line-number = "relative";
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
file-picker.hidden = false;
rulers = [ 120 ];
color-modes = true;
text-width = 120;
cursorline = true;
shell = [ "fish" "-c" ];
statusline = {
mode = {
normal = "NORMAL";
insert = "INSERT";
select = "SELECT";
};
};
lsp = {
display-messages = true;
display-inlay-hints = true;
};
auto-pairs = {
"(" = ")";
"{" = "}";
"[" = "]";
"\"" = "\"";
"`" = "`";
"<" = ">";
};
whitespace = {
render = {
space = "all";
tab = "all";
};
};
indent-guides = {
render = true;
skip-levels = 1;
};
};
keys = {
normal = {
tab = "move_parent_node_end";
S-tab = "move_parent_node_start";
};
insert = {
S-tab = "move_parent_node_start";
};
select = {
tab = "extend_parent_node_end";
S-tab = "extend_parent_node_start";
};
};
};
languages = {
language = [
{
name = "nix";
formatter = { command = "nixpkgs-fmt"; };
auto-format = true;
}
];
};
};
fish = {
enable = true;
interactiveShellInit = ''
# use empty greeting
set fish_greeting
# custom gruvbox theme
set_gruvbox_theme
# use vi keybindings, but inherit emacs keybindings too
fish_hybrid_key_bindings
# emulate the vi cursor shape behavior
set fish_vi_force_cursor 1
fish_vi_cursor
set fish_cursor_default block
set fish_cursor_insert line
set fish_cursor_replace_one underscore
set fish_cursor_replace underscore
set fish_cursor_external line
function starship_transient_rprompt_func
starship module line_break
starship module time
end
'';
shellAbbrs = {
nrs = "nixos-rebuild switch --use-remote-sudo";
zj = "zellij";
};
functions = {
set_gruvbox_theme = {
body = ''
# Gruvbox color palette with medium contrast
set -l gruvbox_bg 282828 # Dark background
set -l gruvbox_fg ebdbb2 # Light foreground
set -l gruvbox_bg0_h 1d2021 # Darker background
set -l gruvbox_bg1 3c3836 # Lighter background
set -l gruvbox_fg4 a89984 # Dark foreground
set -l gruvbox_gray 928374 # Gray
set -l gruvbox_red cc241d # Red
set -l gruvbox_green 98971a # Green
set -l gruvbox_yellow d79921 # Yellow
set -l gruvbox_blue 458588 # Blue
set -l gruvbox_purple b16286 # Purple
set -l gruvbox_aqua 689d6a # Aqua
set -l gruvbox_orange d65d0e # Orange
# Bright variants
set -l gruvbox_red_bright fb4934 # Bright red
set -l gruvbox_green_bright b8bb26 # Bright green
set -l gruvbox_yellow_bright fabd2f # Bright yellow
set -l gruvbox_blue_bright 83a598 # Bright blue
set -l gruvbox_purple_bright d3869b # Bright purple
set -l gruvbox_aqua_bright 8ec07c # Bright aqua
set -l gruvbox_orange_bright fe8019 # Bright orange
# Use defined colors from the Gruvbox palette
set -g fish_color_normal $gruvbox_fg
set -g fish_color_command $gruvbox_blue --bold
set -g fish_color_keyword $gruvbox_red --bold
set -g fish_color_quote $gruvbox_green_bright
set -g fish_color_redirection $gruvbox_orange
set -g fish_color_end $gruvbox_orange
set -g fish_color_error $gruvbox_red_bright --italics
set -g fish_color_param $gruvbox_fg
set -g fish_color_comment $gruvbox_gray
set -g fish_color_match --background=$gruvbox_bg0_h
set -g fish_color_search_match --background=$gruvbox_yellow --foreground=$gruvbox_bg
set -g fish_color_selection --background=$gruvbox_bg1 --foreground=$gruvbox_yellow_bright
set -g fish_color_history_current --background=$gruvbox_bg1
set -g fish_color_operator $gruvbox_aqua
set -g fish_color_escape $gruvbox_purple_bright
set -g fish_color_valid_path $gruvbox_blue_bright --underline
set -g fish_color_option $gruvbox_yellow --italics
set -g fish_color_autosuggestion $gruvbox_fg4
set -g fish_color_cancel $gruvbox_orange_bright --reverse
set -g fish_pager_color_description '$yellow' '-i'
set -g fish_pager_color_prefix 'normal' '--bold' '--underline'
set -g fish_pager_color_progress '--background=cyan'
set -g fish_pager_color_selected_background -r
'';
};
};
};
bat = {
enable = true;
};
wezterm = {
enable = true;
enableZshIntegration = true;
extraConfig = builtins.readFile ./.wezterm.lua;
};
zsh = {
enable = true;
autosuggestion.enable = true;
# defaultKeymap = "viins";
enableCompletion = true;
history.expireDuplicatesFirst = true;
shellAliases = {
fixup = "git add -u && git commit --amend --no-edit && git push -f";
zj = "zellij";
ncu = "nixos-rebuild switch --use-remote-sudo";
};
syntaxHighlighting = {
enable = true;
highlighters = [
"main"
"brackets"
];
};
};
git = {
enable = true;
userName = "Rock Boynton";
userEmail = "rock.boynton@yahoo.com";
};
direnv = {
enable = true;
nix-direnv.enable = true;
enableZshIntegration = true;
# enableFishIntegration = true;
};
fzf = {
enable = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
starship = {
enable = true;
enableZshIntegration = true;
enableFishIntegration = true;
enableTransience = true;
settings = {
palette = "gruvbox_dark";
palettes.gruvbox_dark = {
color_fg0 = "#fbf1c7";
color_bg1 = "#3c3836";
color_bg3 = "#665c54";
color_blue = "#458588";
color_aqua = "#689d6a";
color_green = "#98971a";
color_orange = "#d65d0e";
color_purple = "#b16286";
color_red = "#cc241d";
color_yellow = "#d79921";
};
format = builtins.concatStringsSep "" [
"[](color_orange)"
"$os"
"$username"
"[](bg:color_yellow fg:color_orange)"
"$directory"
"[](fg:color_yellow bg:color_aqua)"
"$git_branch"
"$git_status"
"$git_state"
"[](fg:color_aqua bg:color_blue)"
"$c"
"$rust"
"$haskell"
"$python"
"[](fg:color_blue bg:color_bg3)"
"$nix_shell"
"[](fg:color_bg3 bg:color_bg1)"
"$time"
"$cmd_duration"
"[ ](fg:color_bg1)"
"$line_break$character"
];
os = {
disabled = false;
style = "bg:color_orange fg:color_fg0";
symbols = {
NixOS = " ";
Macos = " ";
};
};
username = {
show_always = true;
style_user = "bg:color_orange fg:color_fg0";
style_root = "bg:color_orange fg:color_fg0";
format = "[ $user ]($style)";
};
directory = {
style = "fg:color_fg0 bg:color_yellow";
format = "[ $path ]($style)";
truncation_length = 3;
truncation_symbol = "…/";
};
git_branch = {
symbol = "";
style = "bg:color_aqua";
format = "[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)";
};
git_status = {
style = "bg:color_aqua";
format = "[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)";
};
git_state = {
style = "bg:color_aqua";
format = "[[\\($state( $progress_current/$progress_total)\\)](fg:color_yellow bg:color_aqua)]($style)";
};
c = {
symbol = " ";
style = "bg:color_blue";
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)";
};
rust = {
symbol = "";
style = "bg:color_blue";
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)";
};
haskell = {
symbol = "";
style = "bg:color_blue";
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)";
};
python = {
symbol = "";
style = "bg:color_blue";
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)";
};
nix_shell = {
symbol = "";
style = "bg:color_blue";
format = "[[ $symbol $state( \\($name\\))](fg:#83a598 bg:color_bg3)]($style)";
heuristic = true;
};
time = {
disabled = false;
time_format = "%R";
style = "bg:color_bg1";
format = "[[ $time ](fg:color_fg0 bg:color_bg1)]($style)";
};
cmd_duration = {
style = "bg:color_bg1";
format = "[[ took $duration ](fg:color_yellow bg:color_bg1)]($style)";
};
line_break = {
disabled = false;
};
character = {
disabled = false;
success_symbol = "[](bold fg:color_green)";
error_symbol = "[](bold fg:color_red)";
vimcmd_symbol = "[](bold fg:color_green)";
vimcmd_replace_one_symbol = "[](bold fg:color_yellow)";
vimcmd_replace_symbol = "[](bold fg:color_orange)";
vimcmd_visual_symbol = "[](bold fg:color_purple)";
};
};
};
thefuck = {
enable = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
zellij = {
enable = true;
enableZshIntegration = true;
enableFishIntegration = true;
settings = {
keybinds = {
normal = {
unbind = [ "Alt -" "Alt +" "Alt =" ];
};
};
};
};
zoxide = {
enable = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
};
}