-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhome.nix
494 lines (446 loc) · 13.9 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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
{
pkgs,
config,
...
}: {
# Home Manager needs a bit of information about you and the
# paths it should manage.
xdg.enable = true;
home.username = "raikusy";
home.homeDirectory = "/Users/raikusy";
home.preferXdgDirectories = true;
home.enableNixpkgsReleaseCheck = false;
home.packages = with pkgs; [
# Shell and Core Utils
grc # Colorize terminal output
fish # Friendly Interactive Shell
starship # Cross-shell prompt
direnv # Environment switcher
lazygit # Git UI
tmux # Tmux
rip2 # Better rm
_1password-cli # 1Password CLI
just # Justfile runner
antidote # Antidote plugin manager
# Text Editors
neovim # Hyperextensible Vim-based text editor
# File Management and Navigation
yazi # Terminal file manager
eza # Modern replacement for ls
fd # Simple, fast alternative to find
bat # Cat clone with syntax highlighting
zoxide # Smarter cd command
kondo # Save disk space by cleaning unneeded files
ox # Independent Rust text editor that runs in your terminal
superfile # Supercharged file manager
# Search and Filter
ripgrep # Fast grep alternative
fzf # Fuzzy finder
# Development Tools
git # Version control system
nil # Nix language server
nixd
alejandra # Nix code formatter
fh # Nix package manager
gh # GitHub CLI
git-credential-manager # Git credential manager
delta # Better git diffs
difftastic # Structural diff tool
act # Run GitHub Actions locally
actionlint # GitHub Actions linting
action-validator # GitHub Actions validator
cocoapods # iOS dependency manager
watchman # File watching service
brotli # Brotli compression format
pigz # Parallel gzip
node-gyp
# Package Managers
volta # JavaScript tool manager
cargo-update # Update Rust packages
# Programming Languages & Runtimes
rustup # Rust toolchain installer
rustc # Rust compiler
rustlings # Rust learning exercises
bun # All-in-one JavaScript runtime & toolkit
deno # JavaScript/TypeScript runtime
# Container & Virtualization
docker # Container platform
docker-compose # Multi-container Docker applications
colima # Container runtime for macOS
# Network Tools
curl # Transfer data with URLs
wget # Network file retriever
# macOS Specific
m-cli # Swiss Army Knife for macOS
mas # Mac App Store CLI
xcode-install # Install and update Xcode
# Cloud & Infrastructure
awscli2 # AWS CLI
# Additional Development Tools
fnm # Fast Node Manager
go # Go programming language
# Security Tools
age # Modern encryption tool
sops # Secrets management
# System Monitoring & Performance
mactop # macOS system monitor
topgrade # System upgrade tool
fastfetch # Fast fetch
bottom # System monitor with nice graphs
htop # Interactive process viewer
hyperfine # Command-line benchmarking tool
bandwhich # Network utilization tool
# Misc Tools
sherlock # Hunt down social media accounts
jq # JSON processor
yq # YAML processor
# GUI Apps
telegram-desktop # Telegram
# maccy # Clipboard manager
# wezterm # WezTerm Terminal Emulator
# karabiner-elements # Keyboard customizer
# arc-browser # Arc Browser
# warp-terminal # Warp Terminal
# raycast # Raycast
];
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "24.05";
home.file = {
".nix-profile" = {
source = "${config.home.sessionVariables.USER_PROFILE}";
recursive = true;
};
};
home.sessionVariables = {
DOTFILES = "${config.home.homeDirectory}/dotfiles";
EDITOR = "cursor";
WORK = "${config.home.homeDirectory}/workspace";
USER_PROFILE = "/etc/static/profiles/per-user/${config.home.username}";
NIX_PROFILE = "${config.home.homeDirectory}/.nix-profile";
NODE_OPTIONS = "--max-old-space-size=8192";
BUN_INSTALL = "${config.home.homeDirectory}/.bun";
VOLTA_HOME = "${config.home.homeDirectory}/.volta";
GEM_HOME = "${config.home.homeDirectory}/.gem";
DENO_INSTALL = "${config.home.homeDirectory}/.deno";
DOCKER_BUILDKIT = "1";
DOCKER_HOST = "unix://${config.xdg.configHome}/colima/default/docker.sock";
COMPOSE_DOCKER_CLI_BUILD = "1";
HOMEBREW_NO_ANALYTICS = "1";
COLORTERM = "truecolor";
TERM = "xterm-256color";
RUST_TARGET = "aarch64-apple-darwin";
CARGO_NET_GIT_FETCH_WITH_CLI = "true";
HYPERFINE_MIN_RUNS = "10";
WATCHMAN_CONFIG_FILE = "${config.xdg.configHome}/watchman/config.json";
CARGO_HOME = "${config.home.homeDirectory}/.cargo";
};
home.sessionPath = [
"${config.home.homeDirectory}/bin"
"${config.home.homeDirectory}/.local/bin"
"${config.home.homeDirectory}/.gem/bin"
"${config.home.homeDirectory}/.volta/bin"
"${config.home.homeDirectory}/.deno/bin"
"${config.home.homeDirectory}/.bun/bin"
"${config.home.homeDirectory}/.nix-profile/bin"
"${config.xdg.stateHome}/nix/profile/bin"
"/run/current-system/sw/bin"
"/nix/var/nix/profiles/default/bin"
"/Applications/Windsurf.app/Contents/Resources/app/bin"
"${config.home.sessionVariables.CARGO_HOME}/bin"
];
programs = {
# Let Home Manager install and manage itself.
home-manager = {
enable = true;
};
bun = {
enable = true;
settings = {
smol = true;
};
};
zsh = {
enable = true;
antidote = {
enable = true;
useFriendlyNames = true;
plugins = [
# Let's go ahead and use all of Oh My Zsh's lib directory.
"ohmyzsh/ohmyzsh path:lib"
"ohmyzsh/ohmyzsh path:plugins/extract"
# Now, let's pick our Oh My Zsh utilty plugins
"ohmyzsh/ohmyzsh path:plugins/colored-man-pages"
"ohmyzsh/ohmyzsh path:plugins/copybuffer"
"ohmyzsh/ohmyzsh path:plugins/copyfile"
"ohmyzsh/ohmyzsh path:plugins/copypath"
"ohmyzsh/ohmyzsh path:plugins/globalias"
"ohmyzsh/ohmyzsh path:plugins/magic-enter"
"ohmyzsh/ohmyzsh path:plugins/fancy-ctrl-z"
"ohmyzsh/ohmyzsh path:plugins/otp"
"ohmyzsh/ohmyzsh path:plugins/zoxide"
# Add some programmer plugins
"ohmyzsh/ohmyzsh path:plugins/git"
"ohmyzsh/ohmyzsh path:plugins/docker"
"ohmyzsh/ohmyzsh path:plugins/docker-compose"
"ohmyzsh/ohmyzsh path:plugins/vscode"
"ohmyzsh/ohmyzsh path:plugins/node"
# Add macOS specific plugins
"ohmyzsh/ohmyzsh path:plugins/brew conditional:is-macos"
"ohmyzsh/ohmyzsh path:plugins/macos conditional:is-macos"
"MichaelAquilina/zsh-you-should-use"
"olets/zsh-abbr kind:defer"
# Add binary utils
# romkatv/zsh-bench kind:path
# Add core plugins that make Zsh a bit more like Fish
"zsh-users/zsh-completions path:src kind:fpath"
"zsh-users/zsh-autosuggestions"
"zsh-users/zsh-history-substring-search"
"zdharma-continuum/fast-syntax-highlighting"
# rupa/z
# or lighter-weight ones like zsh-utils
"belak/zsh-utils path:editor"
"belak/zsh-utils path:history"
"belak/zsh-utils path:prompt"
"belak/zsh-utils path:utility"
"belak/zsh-utils path:completion"
];
};
oh-my-zsh = {
enable = true;
};
syntaxHighlighting.enable = true;
zsh-abbr.enable = true;
initExtraFirst = ''
. "$HOME/Library/Application Support/amazon-q/shell/zshrc.pre.zsh"
'';
initExtra = ''
op completion zsh | source
fh completion zsh | source
rip completions zsh | source
colima completion zsh | source
. "$HOME/Library/Application Support/amazon-q/shell/zshrc.post.zsh"
'';
};
fish = {
enable = true;
# Add useful shell functions
functions = {
fish_greeting = ""; # Disable greeting
# Add more custom functions here
dco = ''
if type -q docker compose
docker compose $argv
else if type -q docker-compose
docker-compose $argv
else
echo "docker compose or docker-compose not found"
echo "Please install docker compose"
echo " \`brew install docker-compose\`"
end
'';
cat = ''
bat --paging=never --style=auto $argv
'';
where = ''
if test (count $argv) -eq 0
echo "Usage: where <command>"
return 1
end
type -a $argv
'';
asq = ''
q chat "$argv"
'';
rm = ''
rip $argv
'';
};
# Add environment variables in a more organized way
loginShellInit =
builtins.readFile "${config.home.homeDirectory}/dotfiles/config/fish/conf.d/99_custom_init.fish"
+ ''
op completion fish | source
fh completion fish | source
rip completions fish | source
colima completion fish | source
'';
plugins = [
{
name = "osx";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-osx";
rev = "main";
sha256 = "sha256-jSUIk3ewM6QnfoAtp16l96N1TlX6vR0d99dvEH53Xgw=";
};
}
{
name = "replay.fish";
src = pkgs.fetchFromGitHub {
owner = "jorgebucaran";
repo = "replay.fish";
rev = "main";
sha256 = "sha256-TzQ97h9tBRUg+A7DSKeTBWLQuThicbu19DHMwkmUXdg=";
};
}
{
name = "gitnow";
src = pkgs.fetchFromGitHub {
owner = "joseluisq";
repo = "gitnow";
rev = "main";
sha256 = "sha256-PuorwmaZAeG6aNWX4sUTBIE+NMdn1iWeea3rJ2RhqRQ=";
};
}
{
name = "colored_man_pages.fish";
src = pkgs.fetchFromGitHub {
owner = "PatrickF1";
repo = "colored_man_pages.fish";
rev = "main";
sha256 = "sha256-ii9gdBPlC1/P1N9xJzqomrkyDqIdTg+iCg0mwNVq2EU=";
};
}
{
name = "fzf-fish";
src = pkgs.fishPlugins.fzf-fish.src;
}
{
name = "plugin-git";
src = pkgs.fishPlugins.plugin-git.src;
}
];
};
starship = {
enable = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
bat = {
enable = true;
config = {
theme = "base16";
};
};
eza = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
git = true;
icons = true;
extraOptions = [
"--group-directories-first"
"--header"
"--octal-permissions"
"--classify=always"
"--color=always"
"--sort=modified"
"--sort=type"
"--git-repos-no-status"
];
};
fzf = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
tmux.enableShellIntegration = true;
};
yazi = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
};
zoxide = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
};
direnv = {
enable = true;
nix-direnv.enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
git = {
enable = true;
userName = "raikusy";
userEmail = "[email protected]";
signing = {
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILi1cbiFBIMivXJpLMBS8w4KsOkPpdMEUd1HW5vzWG5G";
};
extraConfig = {
init.defaultBranch = "main";
pull.ff = "false";
pull.rebase = true;
rebase.autoStash = true;
core = {
editor = "cursor";
autocrlf = "input";
whitespace = "trailing-space,space-before-tab";
};
gpg = {
format = "ssh";
allowedSigners = builtins.readFile "${config.home.homeDirectory}/dotfiles/config/git/allowed-signers";
};
"gpg \"ssh\"" = {
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
};
commit.gpgSign = true;
alias = {
up = "pull --rebase --autostash";
};
credential = {
helper = "!gh auth git-credential";
};
};
};
tmux = {
enable = true;
clock24 = true;
keyMode = "vi";
customPaneNavigationAndResize = true;
terminal = "screen-256color";
plugins = with pkgs.tmuxPlugins; [
sensible
yank
resurrect
continuum
{
plugin = dracula;
extraConfig = ''
set -g @dracula-show-battery false
set -g @dracula-show-powerline true
set -g @dracula-refresh-rate 10
'';
}
];
extraConfig = ''
# Enable mouse support
set -g mouse on
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Automatically renumber windows
set -g renumber-windows on
'';
};
wezterm = {
enable = true;
extraConfig = builtins.readFile "${config.home.homeDirectory}/dotfiles/config/wezterm/wezterm.lua";
};
};
xdg.configFile = {
"starship.toml".source = builtins.toPath "${config.home.homeDirectory}/dotfiles/config/starship/starship.toml";
};
}