-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.nix
executable file
·387 lines (374 loc) · 10.3 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
{ config, pkgs, ... }:
let
homeDir = builtins.getEnv "HOME";
existingNixPath = builtins.getEnv "NIX_PATH";
nixPath = "${homeDir}/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels";
nixvim = import (builtins.fetchGit {
url = "https://github.com/nix-community/nixvim";
# When using a different channel you can use `ref = "nixos-<version>"` to set it here
});
in {
imports = [
nixvim.homeManagerModules.nixvim
];
fonts.fontconfig.enable = true;
#========
#|SYSTEM|
#========
dconf = {
settings = {
"org/gnome/mutter" = {
edge-tiling = "false";
};
"org/gnome/settings-daemon/plugins/power" = {
lid-close-suspend-with-external-monitor = "nothing";
};
};
};
#======
#|HOME|
#======
home = {
username = "joshuaforeman";
homeDirectory = "/home/joshuaforeman";
stateVersion = "24.05"; # josh u are not mrt enough to change this
sessionPath = [
"$HOME/.bin/scripts"
"$HOME/.apps/"
"$HOME/Templates"
];
# dotfiles
file = {
"/.local/share/todo.txt" = { #this is a directory, yes, I know.
source = ./todo;
recursive = true;
};
"/.bin/scripts" = {
source = ./dotfiles/scripts;
recursive = true;
executable = true;
};
"/.bin/applications" = {
source = ./dotfiles/applications;
recursive = true;
executable = true;
};
"/.bin/.snippets" = {
source = ./dotfiles/snippets;
recursive = true;
};
"/Templates" = {
source = ./dotfiles/templates;
recursive = true;
};
};
};
#==========
#|PACKAGES|
#==========
home.packages = with pkgs; [
# fonts
cascadia-code # monocode
open-sans # sans serif
arcticons-sans # sans serif
poly # serif
inriafonts # sans serif + serif
# tui
tldr
# gui
];
#==========
#|PROGRAMS|
#==========
programs = {
# Let Home Manager install and manage itself.
home-manager.enable = true;
# shell language... maybe go fish one day
bash = {
enable = true;
sessionVariables = {
EDITOR = "vim";
VISUAL = "vim";
};
shellAliases = {
hms = "home-manager switch";
hme = "home-manager edit";
# cd
# cdb = "cd -";
# za = "zoxide add .";
# za = "z --searchAdjacent";
# lsd
lsa = "lsd --almost-all";
lst = "lsd --tree --depth=1";
lstr = "lsd --tree --depth=2";
lstre = "lsd --tree --depth=3";
lstree = "lsd --tree --depth=4";
# nix
nix-command = "nix --extra-experimental-features nix-command";
ns = "nix-shell";
};
profileExtra = ''
# .bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
if [ -e /home/joshuaforeman/.nix-profile/etc/profile.d/nix.sh ]; then . /home/joshuaforeman/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
'';
bashrcExtra = ''
# .bashrc
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# export SYSTEMD_PAGER=
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
eval "$(starship init bash)"
eval "$(zoxide init bash)"
'';
};
# version control
git = {
enable = true;
userName = "Joshua Foreman";
userEmail = "[email protected]"; # private, github-provided, commit email
aliases = {
aa = "add --all";
c = "commit";
cm = "commit --message";
ca = "commit --amend";
l = "log";
lo = "log --oneline";
last = "log -1 HEAD --stat";
# search log by author
# short diff
unstage = "reset HEAD";
uncache = "rm --cached";
patch = "git add --patch";
s = "switch";
};
extraConfig = {
init = {
defaultBranch = "main";
};
};
};
gh.enable = true;
# network via ssh
ssh = { enable = true; };
# editors
emacs.enable = true;
nixvim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
opts = {
smartcase = true;
expandtab = true;
shiftwidth = 4;
tabstop = 4;
relativenumber = true;
number = true;
};
extraConfigVim = ''
filetype plugin indent on
syntax on
set mouse=
set autoindent
set spell spelllang=en_us
set foldmethod=indent
set foldlevel=5
set wildmenu
" Make wildmenu behave like similar to Bash completion.
set wildmode=list:longest
" There are certain files that we would never want to edit with Vim.
" Wildmenu will ignore files with these extensions.
set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
set showmode
" show hidden characters
set list
set listchars=tab:>>,trail:-,nbsp:+
" this command clears the last used search pattern:
" :let @/ = ""
" augroup vimrc
" au BufReadPre * setlocal foldmethod=indent
" au BufWinEnter * if &fdm == 'indent' | setlocal foldmethod=manual | endif
" augroup END
'';
wrapRc = false;
# - - - - - -
#|APPEARANCE|
# - - - - - -
colorschemes.kanagawa = {
enable = true;
settings = {
theme = "dragon";
commentStyle.italic = true;
compile = true;
dimInactive = true;
transparent = true;
background.light = "lotus";
background.dark = "dragon";
};
};
# - - - -
#|PLUGINS|
# - - - -
plugins = {
mini = {
enable = true;
mockDevIcons = true;
modules = {
# "editing experience"
ai = {};
operators = {};
surround = {
respect_selection_type = true;
};
comment = {};
completion = {};
clue = {};
# "general workflow"
bracketed = {};
jump2d = {
view = {
n_steps_ahead = 2;
};
};
# "appearance"
icons = {};
notify = {};
statusline = {};
tabline = {
# format buffer line:
# buffernum symbol filename.fiiletype
};
git = {};
diff = {
view = {
style = "sign";
};
};
};
};
### Quality of Life plugins
# reading
helpview.enable = true;
guess-indent.enable = true;
# searching
telescope.enable = true;
harpoon.enable = true;
# focusing
zen-mode.enable = true;
twilight.enable = true;
### Note-taking plugins
zk.enable = true;
# maybe C-n + Z
vimtex.enable = false;
telekasten.enable = false;
mkdnflow.enable = false;
orgmode.enable = false;
### Miscellaneous plugins
mark-radar.enable = true; # mark navigation
sniprun.enable = true; # visual-selected code execution
colorizer.enable = true; # highlight color codes
neocord.enable = false; # discord presence
lz-n.enable = false; # lazy load
# something that draws... Venn.nvim seems great
### Coding plugins
lsp = {
enable = true;
inlayHints = true;
servers = {
nil_ls.enable = true; # nix
bashls.enable = true; # bash
ccls.enable = true; # c/c++
zls.enable = false; # zig
metals.enable = false; # scala
jdtls.enable = true; # java
html.enable = true; # html
cssls.enable = true; # css
denols.enable = true; # js/ts
jsonls.enable = true; # json
marksman.enable = true; # markdown
vale_ls.enable = false; # technical writing
ltex.enable = false; # latex
};
};
lsp-status.enable = true;
treesitter = {
enable = true;
settings = {
auto_install = true;
highlight.enable = true;
indent.enable = true;
};
};
# git
gitblame = { # in-line git blame message
enable = true;
settings = {
delay = 500;
message_template = "<summary>";
set_extmark_options = {
virt_text_pos = "right_align";
};
};
};
# test-driven development
neotest.enable = false; # better testing
## maybe C-n + T
# debugging
dap.enable = false; # debug adapter protocol
# snippets
emmet.enable = false; # superior web snippets, to be learned
# commenting
neogen.enable = true; # better code annotations
## maybe C-n + G
# maybe later...
ollama.enable = false; # interact with LLMs
};
};
#
lsd = {
enable = true;
enableAliases = false;
settings = {
sorting.column = "extension";
};
};
zathura.enable = false; # document viewer, needs config
zoxide.enable = true; # better cd, meh
fzf.enable = true; # fuzzy find
ranger.enable = true; # tui file system navigation
tmux = {
enable = true;
keyMode = "vi";
plugins = [
];
};
less.enable = true;
zk.enable = true;
#------------
#|APPEARANCE|
#------------
fastfetch.enable = true;
starship = {
enable = true;
settings = {};
};
};
}