tangled
alpha
login
or
join now
bwc9876.dev
/
nixos-config
1
fork
atom
Flake for my NixOS devices
1
fork
atom
overview
issues
pulls
pipelines
Neovim improvements
bwc9876.dev
1 month ago
e99f6362
37fa66af
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+342
-453
4 changed files
expand all
collapse all
unified
split
flake.lock
homeModules
dev.nix
nvim.nix
nixosModules
network.nix
+24
-24
flake.lock
···
31
31
]
32
32
},
33
33
"locked": {
34
34
-
"lastModified": 1767967164,
35
35
-
"narHash": "sha256-Cx4VETh9dGoQYDtWhre7g66d7SAr+h1h6f+SSHxVrck=",
34
34
+
"lastModified": 1768575137,
35
35
+
"narHash": "sha256-e0SsKnkSnq+UwZNS9ZyPJjTjabzq9TRc1hqeDnvOF1Q=",
36
36
"owner": "catppuccin",
37
37
"repo": "nix",
38
38
-
"rev": "e973584280e3b0e1d5b5a1a5e9948dc222c54af7",
38
38
+
"rev": "48e67b4ad22072f1ae30b0ed8e1cb020cf06c611",
39
39
"type": "github"
40
40
},
41
41
"original": {
···
362
362
]
363
363
},
364
364
"locked": {
365
365
-
"lastModified": 1768397254,
366
366
-
"narHash": "sha256-hhvxV6RUxagnwE7WEYbm7vRaR0MtdNn2Brm3rqPNj4E=",
365
365
+
"lastModified": 1768707181,
366
366
+
"narHash": "sha256-GdwFfnwdUgABFpc4sAmX7GYx8eQs6cEjOPo6nBJ0YaI=",
367
367
"owner": "nix-community",
368
368
"repo": "home-manager",
369
369
-
"rev": "a0a505f803cb74a2bd386a1604973107f7e6c19b",
369
369
+
"rev": "83bcb17377f0242376a327e742e9404e9a528647",
370
370
"type": "github"
371
371
},
372
372
"original": {
···
469
469
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
470
470
},
471
471
"locked": {
472
472
-
"lastModified": 1768400089,
473
473
-
"narHash": "sha256-w/jvQHJplvsHjxtv9kYsUDfc+CW/FMIuc0PIgsmGL0s=",
472
472
+
"lastModified": 1768684335,
473
473
+
"narHash": "sha256-YLjGGcSNE2lK+TUqDFEX6IBjPZNjLaoxAXji3mmZbvs=",
474
474
"owner": "sodiboo",
475
475
"repo": "niri-flake",
476
476
-
"rev": "904cf223bd25b5b40fc8a4254e542507674f0333",
476
476
+
"rev": "c133a45b02dba5fd229532067d6a22d5209436d6",
477
477
"type": "github"
478
478
},
479
479
"original": {
···
502
502
"niri-unstable": {
503
503
"flake": false,
504
504
"locked": {
505
505
-
"lastModified": 1768196703,
506
506
-
"narHash": "sha256-mttBQdVnVFO3mn+M+oqCsZZOtS2HvXYy+VaHxb8YuMw=",
505
505
+
"lastModified": 1768678265,
506
506
+
"narHash": "sha256-Ub8eed4DsfIDWyg30xEe+8bSxL/z5Af/gCjmvJ0V/Hs=",
507
507
"owner": "YaLTeR",
508
508
"repo": "niri",
509
509
-
"rev": "3672e79369d72297abda8878245ea4ec327062c6",
509
509
+
"rev": "d7184a04b904e07113f4623610775ae78d32394c",
510
510
"type": "github"
511
511
},
512
512
"original": {
···
537
537
},
538
538
"nixos-hardware": {
539
539
"locked": {
540
540
-
"lastModified": 1768397375,
541
541
-
"narHash": "sha256-7QqbFi3ERvKjEdAzEYPv7iSGwpUKSrQW5wPLMFq45AQ=",
540
540
+
"lastModified": 1768736227,
541
541
+
"narHash": "sha256-qgGq7CfrYKc3IBYQ7qp0Z/ZXndQVC5Bj0N8HW9mS2rM=",
542
542
"owner": "NixOS",
543
543
"repo": "nixos-hardware",
544
544
-
"rev": "efe2094529d69a3f54892771b6be8ee4a0ebef0f",
544
544
+
"rev": "d447553bcbc6a178618d37e61648b19e744370df",
545
545
"type": "github"
546
546
},
547
547
"original": {
···
552
552
},
553
553
"nixpkgs": {
554
554
"locked": {
555
555
-
"lastModified": 1768127708,
556
556
-
"narHash": "sha256-1Sm77VfZh3mU0F5OqKABNLWxOuDeHIlcFjsXeeiPazs=",
555
555
+
"lastModified": 1768564909,
556
556
+
"narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=",
557
557
"owner": "NixOS",
558
558
"repo": "nixpkgs",
559
559
-
"rev": "ffbc9f8cbaacfb331b6017d5a5abb21a492c9a38",
559
559
+
"rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f",
560
560
"type": "github"
561
561
},
562
562
"original": {
···
568
568
},
569
569
"nixpkgs-stable": {
570
570
"locked": {
571
571
-
"lastModified": 1768323494,
572
572
-
"narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=",
571
571
+
"lastModified": 1768621446,
572
572
+
"narHash": "sha256-6YwHV1cjv6arXdF/PQc365h1j+Qje3Pydk501Rm4Q+4=",
573
573
"owner": "NixOS",
574
574
"repo": "nixpkgs",
575
575
-
"rev": "2c3e5ec5df46d3aeee2a1da0bfedd74e21f4bf3a",
575
575
+
"rev": "72ac591e737060deab2b86d6952babd1f896d7c5",
576
576
"type": "github"
577
577
},
578
578
"original": {
···
591
591
"systems": "systems"
592
592
},
593
593
"locked": {
594
594
-
"lastModified": 1767906546,
595
595
-
"narHash": "sha256-AoSWS8+P+7hQ/jIdv0wBjgH1MvnerdWBFXO4GV3JoQs=",
594
594
+
"lastModified": 1768486009,
595
595
+
"narHash": "sha256-I7ymDe6UQooHy9I9wrafKCCDnRbox/EMWAgJgpm7fGs=",
596
596
"owner": "nix-community",
597
597
"repo": "nixvim",
598
598
-
"rev": "7eb8f36f085b85a2aeff929aff52d0f6aa14e000",
598
598
+
"rev": "03a638205b5cb04ba9c2ed6c604e137b15f07fa1",
599
599
"type": "github"
600
600
},
601
601
"original": {
+1
-1
homeModules/dev.nix
···
102
102
])
103
103
++ (lib.optionals conf.python [
104
104
python3
105
105
-
poetry
105
105
+
# poetry
106
106
pipenv
107
107
uv
108
108
ruff
+308
-421
homeModules/nvim.nix
···
18
18
19
19
home.sessionVariables.EDITOR = "nvim";
20
20
21
21
-
programs.neovide = lib.mkIf config.cow.gdi.enable {
22
22
-
enable = true;
23
23
-
settings = {
24
24
-
fork = true;
25
25
-
font = {
26
26
-
normal = [{family = "monospace";}];
27
27
-
size = 18.0;
28
28
-
};
29
29
-
title-hidden = false;
30
30
-
};
31
31
-
};
21
21
+
programs.nixvim = {
22
22
+
# Meta
32
23
33
33
-
programs.nixvim = {
34
24
enable = true;
35
25
enableMan = false;
36
26
defaultEditor = true;
···
38
28
vimAlias = true;
39
29
40
30
nixpkgs.pkgs = pkgs;
41
41
-
clipboard.providers.wl-copy.enable = config.cow.gdi.enable;
42
31
43
43
-
globals.mapleader = " ";
32
32
+
performance = {
33
33
+
byteCompileLua = {
34
34
+
enable = true;
35
35
+
nvimRuntime = true;
36
36
+
plugins = true;
37
37
+
};
38
38
+
combinePlugins = {
39
39
+
enable = true;
40
40
+
};
41
41
+
};
42
42
+
43
43
+
# Theming
44
44
45
45
colorschemes.catppuccin = lib.mkIf config.cow.cat.enable {
46
46
enable = true;
···
50
50
no_bold = false;
51
51
no_italics = false;
52
52
term_colors = true;
53
53
-
# transparent_background = true;
54
53
integrations = {
55
54
alpha = true;
56
55
dropbar.enabled = true;
···
92
91
};
93
92
};
94
93
94
94
+
# Misc. Global Options
95
95
+
95
96
extraConfigLua = ''
96
97
vim.diagnostic.config({
97
98
signs = {
···
101
102
},
102
103
},
103
104
})
104
104
-
vim.g.neovide_cursor_vfx_mode = "pixiedust"
105
105
-
106
106
-
-- require("satellite").setup({})
107
105
'';
108
106
109
109
-
autoGroups = {
110
110
-
restore_cursor = {};
111
111
-
open_neotree = {};
112
112
-
};
113
113
-
114
114
-
filetype.extension = {
115
115
-
mdx = "mdx";
116
116
-
};
117
117
-
118
107
opts = {
119
108
number = true;
120
109
relativenumber = true;
···
124
113
tabstop = 2;
125
114
shiftwidth = 2;
126
115
breakindent = true;
127
127
-
fillchars.__raw = ''[[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]'';
116
116
+
fillchars.__raw = "[[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]";
128
117
foldcolumn = "1";
129
129
-
foldlevel = 10;
130
130
-
foldlevelstart = 10;
118
118
+
foldlevel = 100;
119
119
+
foldlevelstart = 100;
131
120
foldenable = true;
132
121
mouse = "";
133
122
};
123
123
+
124
124
+
# Allow system clipboard copying if graphical env is enabled
125
125
+
clipboard.providers.wl-copy.enable = lib.mkDefault config.cow.gdi.enable;
126
126
+
127
127
+
# Associate .mdx extension to mdx buffer type
128
128
+
filetype.extension = {
129
129
+
mdx = "mdx";
130
130
+
};
131
131
+
132
132
+
# Auto Run Commands
134
133
135
134
autoCmd = [
136
135
{
···
150
149
end
151
150
'';
152
151
}
153
153
-
{
154
154
-
group = "open_neotree";
155
155
-
event = ["BufRead"];
156
156
-
pattern = "*";
157
157
-
once = true;
158
158
-
callback.__raw = ''
159
159
-
function()
160
160
-
if
161
161
-
vim.bo.filetype ~= "alpha"
162
162
-
and (not vim.g.neotree_opened)
163
163
-
then
164
164
-
vim.cmd "Neotree show"
165
165
-
vim.g.neotree_opened = true
166
166
-
end
167
167
-
end
168
168
-
'';
169
169
-
}
170
152
];
171
153
172
172
-
performance = {
173
173
-
byteCompileLua = {
174
174
-
enable = true;
175
175
-
nvimRuntime = true;
176
176
-
plugins = true;
177
177
-
};
178
178
-
combinePlugins = {
179
179
-
enable = true;
180
180
-
};
154
154
+
autoGroups = {
155
155
+
# Try to restore cursor to the last position it was at last time this file was opened
156
156
+
restore_cursor = {};
181
157
};
158
158
+
159
159
+
# Keybinds
160
160
+
161
161
+
# globals.mapleader = " ";
182
162
183
163
keymaps = let
184
184
-
prefixMap = pre: maps:
164
164
+
prefixMap = group:
185
165
builtins.map (k: {
186
186
-
action = "<cmd>${k.action}<cr>";
187
187
-
key = "${pre}${k.key}";
166
166
+
action = "<cmd>${
167
167
+
if group ? "cmdPrefix"
168
168
+
then group.cmdPrefix + " "
169
169
+
else ""
170
170
+
}${k.action}<cr>";
171
171
+
key = "${group.prefix}${k.key}";
188
172
options = k.options;
189
173
})
190
190
-
maps;
174
174
+
group.keys;
191
175
in
192
176
lib.lists.flatten (
193
177
builtins.map (g:
194
194
-
if builtins.hasAttr "group" g
195
195
-
then prefixMap g.prefix g.keys
178
178
+
if g ? "group"
179
179
+
then prefixMap g
196
180
else g) [
197
181
{
198
182
action = ''"+p'';
···
210
194
options.desc = "Cut to system clipboard";
211
195
}
212
196
{
213
213
-
action = ''<cmd>Format<cr>'';
197
197
+
action = "<cmd>Format<cr>";
214
198
key = "<C-S-I>";
215
199
options.desc = "Format Buffer";
216
200
}
···
229
213
options.desc = "Previous Tab";
230
214
}
231
215
{
232
232
-
action = "Neotree toggle";
216
216
+
action = "Neotree toggle reveal";
233
217
key = "t";
234
218
options.desc = "Toggle Neotree";
235
219
}
···
269
253
{
270
254
group = "LSP Actions";
271
255
prefix = "<C-.>";
256
256
+
cmdPrefix = "Lspsaga";
272
257
keys = [
273
258
{
274
274
-
action = "Lspsaga code_action code_action";
259
259
+
action = "code_action code_action";
275
260
key = "a";
276
261
options.desc = "Code Actions";
277
262
}
278
263
{
279
279
-
action = "Lspsaga rename";
264
264
+
action = "rename";
280
265
key = "r";
281
266
options.desc = "LSP Rename";
282
267
}
283
268
{
284
284
-
action = "Lspsaga diagnostic_jump_next";
269
269
+
action = "diagnostic_jump_next";
285
270
key = "e";
286
271
options.desc = "Next Diagnostic";
287
272
}
288
273
{
289
289
-
action = "Lspsaga diagnostic_jump_previous";
274
274
+
action = "diagnostic_jump_previous";
290
275
key = "E";
291
276
options.desc = "Previous Diagnostic";
292
277
}
293
278
{
294
294
-
action = "Lspsaga goto_definition";
279
279
+
action = "goto_definition";
295
280
key = "d";
296
281
options.desc = "Jump to Definition";
297
282
}
298
283
{
299
299
-
action = "Lspsaga peek_definition";
284
284
+
action = "peek_definition";
300
285
key = "D";
301
286
options.desc = "Peek Definition";
302
287
}
303
288
{
304
304
-
action = "Lspsaga finder ref";
289
289
+
action = "finder ref";
305
290
key = "fr";
306
291
options.desc = "Find References";
307
292
}
308
293
{
309
309
-
action = "Lspsaga finder imp";
294
294
+
action = "finder imp";
310
295
key = "fi";
311
296
options.desc = "Find Implementations";
312
297
}
313
298
{
314
314
-
action = "Lspsaga finder def";
299
299
+
action = "finder def";
315
300
key = "fd";
316
301
options.desc = "Find Definitions";
317
302
}
318
303
{
319
319
-
action = "Lspsaga finder";
304
304
+
action = "finder";
320
305
key = "ff";
321
306
options.desc = "Finder";
322
307
}
323
308
{
324
324
-
action = "Lspsaga hover_doc";
309
309
+
action = "hover_doc";
325
310
key = "h";
326
311
options.desc = "Hover Doc";
327
312
}
328
313
];
329
314
}
330
315
{
331
331
-
action = "<cmd>Telescope<cr>";
332
332
-
key = "<leader><leader>";
333
333
-
options.desc = "Telescope Launch";
316
316
+
group = "Telescope";
317
317
+
prefix = " ";
318
318
+
cmdPrefix = "Telescope";
319
319
+
keys = [
320
320
+
{
321
321
+
key = "u";
322
322
+
action = "undo";
323
323
+
options.desc = "Undo Tree";
324
324
+
}
325
325
+
{
326
326
+
key = "c";
327
327
+
action = "commands";
328
328
+
options.desc = "Browse Commands";
329
329
+
}
330
330
+
{
331
331
+
key = "w";
332
332
+
action = "spell_suggest";
333
333
+
options.desc = "Spell Suggest";
334
334
+
}
335
335
+
{
336
336
+
key = "s";
337
337
+
action = "lsp_document_symbols";
338
338
+
options.desc = "LSP Symbols";
339
339
+
}
340
340
+
{
341
341
+
key = "t";
342
342
+
action = "treesitter";
343
343
+
options.desc = "Treesitter Symbols";
344
344
+
}
345
345
+
{
346
346
+
key = "f";
347
347
+
action = "find_files";
348
348
+
options.desc = "Files";
349
349
+
}
350
350
+
{
351
351
+
key = "gs";
352
352
+
action = "git_status";
353
353
+
options.desc = "Git Status";
354
354
+
}
355
355
+
{
356
356
+
key = "gb";
357
357
+
action = "git_branches";
358
358
+
options.desc = "Git Branches";
359
359
+
}
360
360
+
{
361
361
+
key = "gc";
362
362
+
action = "git_commits";
363
363
+
options.desc = "Git Commits";
364
364
+
}
365
365
+
{
366
366
+
key = "r";
367
367
+
action = "oldfiles";
368
368
+
options.desc = "Recent Files";
369
369
+
}
370
370
+
{
371
371
+
key = "f";
372
372
+
action = "live_grep";
373
373
+
options.desc = "Live Grep";
374
374
+
}
375
375
+
];
334
376
}
335
377
{
336
378
action.__raw = "[[<C-\\><C-n><C-w>]]";
···
352
394
extraPlugins = with pkgs.vimPlugins;
353
395
(lib.optional config.cow.dev.web {plugin = pkgs.nvim-mdx;})
354
396
++ [
355
355
-
{plugin = satellite-nvim;}
356
356
-
{plugin = flatten-nvim;}
357
357
-
{plugin = tiny-devicons-auto-colors-nvim;}
397
397
+
{plugin = flatten-nvim;} # Opens neovim invocations in terminal windows in the current Neovim session
398
398
+
{plugin = satellite-nvim;} # Scrollbar
399
399
+
{plugin = tiny-devicons-auto-colors-nvim;} # Color language icons
358
400
];
359
401
360
402
plugins = {
403
403
+
# Navigation
404
404
+
405
405
+
# Interactive Fuzzy Search w/ various providers
361
406
telescope = {
362
407
enable = true;
363
408
settings.defaults = {
···
368
413
ui-select.enable = true;
369
414
undo.enable = true;
370
415
};
371
371
-
keymaps = lib.fix (self: {
372
372
-
"<leader>u" = {
373
373
-
action = "undo";
374
374
-
options.desc = "Undo Tree";
375
375
-
};
376
376
-
"<leader>c" = {
377
377
-
action = "commands";
378
378
-
options.desc = "Browse Commands";
379
379
-
};
380
380
-
"<leader>w" = {
381
381
-
action = "spell_suggest";
382
382
-
options.desc = "Spell Suggest";
383
383
-
};
384
384
-
"<leader>s" = {
385
385
-
action = "lsp_document_symbols";
386
386
-
options.desc = "LSP Symbols";
387
387
-
};
388
388
-
"<leader>t" = {
389
389
-
action = "treesitter";
390
390
-
options.desc = "Treesitter Symbols";
391
391
-
};
392
392
-
"<leader>f" = {
393
393
-
action = "find_files";
394
394
-
options.desc = "Files";
395
395
-
};
396
396
-
"<leader>gs" = {
397
397
-
action = "git_status";
398
398
-
options.desc = "Git Status";
399
399
-
};
400
400
-
"<leader>gb" = {
401
401
-
action = "git_branches";
402
402
-
options.desc = "Git Branches";
403
403
-
};
404
404
-
"<leader>gc" = {
405
405
-
action = "git_commits";
406
406
-
options.desc = "Git Commits";
407
407
-
};
408
408
-
"<leader>r" = {
409
409
-
action = "oldfiles";
410
410
-
options.desc = "Recent Files";
411
411
-
};
412
412
-
"<leader>l" = self."<C-S-F>";
413
413
-
"<C-S-F>" = {
414
414
-
action = "live_grep";
415
415
-
options.desc = "Live Grep";
416
416
-
};
417
417
-
});
418
416
};
419
417
420
420
-
alpha = {
421
421
-
enable = true;
422
422
-
settings.opts = {
423
423
-
position = "center";
424
424
-
};
425
425
-
settings.layout = let
426
426
-
o = {
427
427
-
position = "center";
428
428
-
};
429
429
-
txt = s: {
430
430
-
type = "text";
431
431
-
val = s;
432
432
-
opts =
433
433
-
{
434
434
-
hl = "Keyword";
435
435
-
}
436
436
-
// o;
437
437
-
};
438
438
-
grp = g: {
439
439
-
type = "group";
440
440
-
val = g;
441
441
-
opts.spacing = 1;
442
442
-
};
443
443
-
btn = {
444
444
-
val,
445
445
-
onClick,
446
446
-
...
447
447
-
}: {
448
448
-
type = "button";
449
449
-
inherit val;
450
450
-
opts = o;
451
451
-
on_press.__raw = "function() vim.cmd[[${onClick}]] end";
452
452
-
};
453
453
-
cmd = {
454
454
-
command,
455
455
-
width,
456
456
-
height,
457
457
-
}: {
458
458
-
type = "terminal";
459
459
-
inherit command width height;
460
460
-
opts = o;
461
461
-
};
462
462
-
pad = {
463
463
-
type = "padding";
464
464
-
val = 2;
465
465
-
};
466
466
-
in
467
467
-
[
468
468
-
pad
469
469
-
pad
470
470
-
]
471
471
-
++ (lib.intersperse pad [
472
472
-
(cmd {
473
473
-
command = ''
474
474
-
${pkgs.toilet}/bin/toilet " NIXVIM " -f mono12 -F border | ${pkgs.lolcat}/bin/lolcat -f
475
475
-
'';
476
476
-
# Hardcoding to prevent IFD
477
477
-
width = 83; # (builtins.stringLength (lib.trim (builtins.elemAt (lib.splitString "\n" bannerText) 1))) - 3;
478
478
-
height = 12; # (builtins.length (lib.splitString "\n" bannerText)) - 1;
479
479
-
})
480
480
-
(grp [
481
481
-
(btn {
482
482
-
val = " Terminal";
483
483
-
onClick = "ToggleTerm";
484
484
-
})
485
485
-
(btn {
486
486
-
val = " Quit";
487
487
-
onClick = "q";
488
488
-
})
489
489
-
])
490
490
-
(grp [
491
491
-
(txt " Neovim Version ${pkgs.neovim.version}")
492
492
-
(txt " NixVim Rev ${builtins.substring 0 5 inputs.nixvim.rev}")
493
493
-
])
494
494
-
])
495
495
-
++ [pad];
496
496
-
};
497
497
-
498
498
-
trouble = {
499
499
-
enable = true;
500
500
-
};
501
501
-
502
502
-
toggleterm = {
503
503
-
enable = true;
504
504
-
luaConfig.post = ''
505
505
-
local flatten = require('flatten')
506
506
-
507
507
-
---@type Terminal?
508
508
-
local saved_terminal
509
509
-
510
510
-
flatten.setup({
511
511
-
hooks = {
512
512
-
should_block = function(argv)
513
513
-
return vim.tbl_contains(argv, "-b")
514
514
-
end,
515
515
-
pre_open = function()
516
516
-
local term = require("toggleterm.terminal")
517
517
-
local termid = term.get_focused_id()
518
518
-
saved_terminal = term.get(termid)
519
519
-
end,
520
520
-
post_open = function(opts)
521
521
-
if saved_terminal then
522
522
-
saved_terminal:close()
523
523
-
else
524
524
-
vim.api.nvim_set_current_win(opts.winnr)
525
525
-
end
526
526
-
527
527
-
if opts.filetype == "gitcommit" or opts.filetype == "gitrebase" then
528
528
-
vim.api.nvim_create_autocmd("BufWritePost", {
529
529
-
buffer = opts.bufnr,
530
530
-
once = true,
531
531
-
callback = vim.schedule_wrap(function()
532
532
-
require('bufdelete').bufdelete(opts.bufnr, true)
533
533
-
end),
534
534
-
})
535
535
-
end
536
536
-
end,
537
537
-
block_end = function()
538
538
-
vim.schedule(function()
539
539
-
if saved_terminal then
540
540
-
saved_terminal:open()
541
541
-
saved_terminal = nil
542
542
-
end
543
543
-
end)
544
544
-
end,
545
545
-
},
546
546
-
window = {
547
547
-
open = "alternate",
548
548
-
},
549
549
-
})
550
550
-
'';
551
551
-
settings = {
552
552
-
size = 20;
553
553
-
open_mapping = "[[<C-x>]]";
554
554
-
direction = "horizontal";
555
555
-
start_in_insert = true;
556
556
-
insert_mappings = true;
557
557
-
terminal_mappings = true;
558
558
-
};
559
559
-
};
560
560
-
561
561
-
treesitter = {
562
562
-
enable = true;
563
563
-
luaConfig.post = lib.mkIf config.cow.dev.web ''
564
564
-
require('mdx').setup()
565
565
-
'';
566
566
-
settings = {
567
567
-
highlight.enable = true;
568
568
-
};
569
569
-
};
570
570
-
418
418
+
# Highlight current row
571
419
illuminate.enable = true;
420
420
+
# Underline matching token in buffer
572
421
cursorline.enable = true;
573
422
574
574
-
# neocord = {
575
575
-
# enable = true;
576
576
-
# settings.logo = "https://raw.githubusercontent.com/IogaMaster/neovim/main/.github/assets/nixvim-dark.webp";
577
577
-
# };
578
578
-
423
423
+
# Nicer bdelete
579
424
bufdelete.enable = true;
580
425
426
426
+
# Tab bar
581
427
bufferline = {
582
428
enable = true;
583
583
-
settings.highlights.__raw = ''
429
429
+
settings.highlights.__raw = lib.mkIf config.cow.cat.enable ''
584
430
require("catppuccin.special.bufferline").get_theme()
585
431
'';
586
432
settings.options = {
···
591
437
{
592
438
filetype = "neo-tree";
593
439
highlight = "String";
594
594
-
text = " Neovim";
440
440
+
text = "Files";
595
441
text_align = "center";
596
442
# separator = true;
597
443
}
598
444
];
599
445
separator_style = "slant";
600
600
-
close_command.__raw = ''require('bufdelete').bufdelete'';
601
446
hover = {
602
447
enabled = true;
603
448
delay = 150;
···
614
459
};
615
460
};
616
461
462
462
+
# Tree file manager
463
463
+
neo-tree = {
464
464
+
enable = true;
465
465
+
settings = {
466
466
+
hide_root_node = false;
467
467
+
follow_current_file.enabled = true;
468
468
+
add_blank_line_at_top = true;
469
469
+
default_component_configs = {
470
470
+
container.right_padding = 2;
471
471
+
name.trailing_slash = true;
472
472
+
indent = {
473
473
+
indent_size = 2;
474
474
+
with_expanders = true;
475
475
+
};
476
476
+
};
477
477
+
window.width = 40;
478
478
+
auto_clean_after_session_restore = true;
479
479
+
close_if_last_window = true;
480
480
+
filesystem.components.name.__raw = ''
481
481
+
function(config, node, state)
482
482
+
local components = require('neo-tree.sources.common.components')
483
483
+
local name = components.name(config, node, state)
484
484
+
if node:get_depth() == 1 then
485
485
+
name.text = vim.fs.basename(vim.loop.cwd() or "") .. "/"
486
486
+
end
487
487
+
return name
488
488
+
end
489
489
+
'';
490
490
+
};
491
491
+
};
492
492
+
493
493
+
# In-buffer UI/tweaks
494
494
+
495
495
+
# Toggle relativenumber off when inserting
496
496
+
numbertoggle.enable = true;
497
497
+
498
498
+
# Folding implementation
499
499
+
nvim-ufo.enable = true;
500
500
+
501
501
+
# Nicer indenting
502
502
+
indent-o-matic.enable = true;
503
503
+
intellitab.enable = true;
504
504
+
505
505
+
# Image Previews
506
506
+
image.enable = true;
507
507
+
508
508
+
# Completions
509
509
+
cmp = {
510
510
+
enable = true;
511
511
+
settings = {
512
512
+
sources = map (name: {inherit name;}) [
513
513
+
"nvim_lsp"
514
514
+
"nvim_lsp_signature_help"
515
515
+
"path"
516
516
+
"buffer"
517
517
+
];
518
518
+
mapping = {
519
519
+
"<Esc>" = "cmp.mapping.abort()";
520
520
+
"<Tab>" = "cmp.mapping.confirm({ select = true })";
521
521
+
"<Up>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
522
522
+
"<Down>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
523
523
+
};
524
524
+
};
525
525
+
};
526
526
+
527
527
+
# LSP Completion providers
528
528
+
cmp-nvim-lsp.enable = true;
529
529
+
cmp-nvim-lsp-document-symbol.enable = true;
530
530
+
531
531
+
# Common Spellings
532
532
+
cmp-spell.enable = true;
533
533
+
534
534
+
# Color-coded matching symbols
535
535
+
rainbow-delimiters.enable = true;
536
536
+
537
537
+
# dropbar = {
538
538
+
# enable = true;
539
539
+
# settings = {
540
540
+
# bar.padding.right = 5;
541
541
+
# bar.padding.left = 1;
542
542
+
# };
543
543
+
# };
544
544
+
545
545
+
# Line number column + LSP + folding + etc.
617
546
statuscol = {
618
547
enable = true;
619
548
settings.segments = let
···
661
590
];
662
591
};
663
592
664
664
-
dropbar = {
665
665
-
enable = true;
666
666
-
settings = {
667
667
-
bar.padding.right = 5;
668
668
-
bar.padding.left = 1;
669
669
-
};
670
670
-
};
671
671
-
672
672
-
nvim-ufo = {
673
673
-
enable = true;
674
674
-
};
675
675
-
676
676
-
# gitgutter = {
677
677
-
# enable = true;
678
678
-
# settings = {
679
679
-
#
680
680
-
# };
681
681
-
# };
682
682
-
593
593
+
# Informational bottom line
683
594
lualine = {
684
595
enable = true;
685
596
settings = {
···
689
600
];
690
601
691
602
options = {
692
692
-
theme = "catppuccin";
603
603
+
theme = lib.mkIf config.cow.cat.enable "catppuccin";
693
604
disabled_filetypes = ["neo-tree"];
694
605
ignore_focus = ["neo-tree"];
695
606
};
696
607
};
697
608
};
698
609
699
699
-
nix-develop = {
700
700
-
enable = true;
701
701
-
package = pkgs.vimPlugins.nix-develop-nvim.overrideAttrs (
702
702
-
prev: next: {
703
703
-
src = pkgs.fetchFromGitHub {
704
704
-
owner = "Bwc9876";
705
705
-
repo = "nix-develop.nvim";
706
706
-
rev = "089cd52191ccbb3726594e21cd96567af6088dd5";
707
707
-
sha256 = "sha256-EIEJk8/IAuG+UICUJ2F8QakgRpFrQ1ezDSJ79NAVuD8=";
708
708
-
};
709
709
-
}
710
710
-
);
711
711
-
};
610
610
+
# New Windows
712
611
713
713
-
neo-tree = {
612
612
+
# Nice notifications and progress indicator
613
613
+
fidget = {
714
614
enable = true;
715
715
-
settings = {
716
716
-
hide_root_node = false;
717
717
-
add_blank_line_at_top = true;
718
718
-
default_component_configs = {
719
719
-
container.right_padding = 2;
720
720
-
name.trailing_slash = true;
721
721
-
indent = {
722
722
-
indent_size = 2;
723
723
-
with_expanders = true;
724
724
-
};
615
615
+
settings.notification = {
616
616
+
override_vim_notify = true;
617
617
+
window = {
618
618
+
y_padding = 2;
619
619
+
x_padding = 2;
620
620
+
zindex = 50;
621
621
+
align = "top";
622
622
+
winblend = 0;
725
623
};
726
726
-
window.width = 40;
727
727
-
auto_clean_after_session_restore = true;
728
728
-
close_if_last_window = true;
729
729
-
filesystem.components.name.__raw = ''
730
730
-
function(config, node, state)
731
731
-
local components = require('neo-tree.sources.common.components')
732
732
-
local name = components.name(config, node, state)
733
733
-
if node:get_depth() == 1 then
734
734
-
name.text = vim.fs.basename(vim.loop.cwd() or "") .. "/"
735
735
-
end
736
736
-
return name
737
737
-
end
738
738
-
'';
739
624
};
740
625
};
741
626
742
742
-
image = {
743
743
-
luaConfig = {
744
744
-
pre = "if not vim.g.neovide then";
745
745
-
post = "end";
746
746
-
};
747
747
-
enable = true;
748
748
-
};
749
749
-
web-devicons.enable = true;
750
750
-
751
751
-
indent-o-matic.enable = true;
752
752
-
intellitab.enable = true;
753
753
-
627
627
+
# Interactive keybind helper
754
628
which-key = {
755
629
enable = true;
756
630
settings = {
···
760
634
};
761
635
};
762
636
763
763
-
fidget = {
637
637
+
# Toggle a Terminal Window
638
638
+
toggleterm = {
764
639
enable = true;
765
765
-
settings.notification = {
766
766
-
override_vim_notify = true;
767
767
-
window = {
768
768
-
y_padding = 2;
769
769
-
x_padding = 2;
770
770
-
zindex = 50;
771
771
-
align = "top";
772
772
-
winblend = 0;
773
773
-
};
640
640
+
luaConfig.post = ''
641
641
+
local flatten = require('flatten')
642
642
+
643
643
+
---@type Terminal?
644
644
+
local saved_terminal
645
645
+
646
646
+
flatten.setup({
647
647
+
hooks = {
648
648
+
should_block = function(argv)
649
649
+
return vim.tbl_contains(argv, "-b")
650
650
+
end,
651
651
+
pre_open = function()
652
652
+
local term = require("toggleterm.terminal")
653
653
+
local termid = term.get_focused_id()
654
654
+
saved_terminal = term.get(termid)
655
655
+
end,
656
656
+
post_open = function(opts)
657
657
+
if saved_terminal then
658
658
+
saved_terminal:close()
659
659
+
else
660
660
+
vim.api.nvim_set_current_win(opts.winnr)
661
661
+
end
662
662
+
663
663
+
if opts.filetype == "gitcommit" or opts.filetype == "gitrebase" then
664
664
+
vim.api.nvim_create_autocmd("BufWritePost", {
665
665
+
buffer = opts.bufnr,
666
666
+
once = true,
667
667
+
callback = vim.schedule_wrap(function()
668
668
+
require('bufdelete').bufdelete(opts.bufnr, true)
669
669
+
end),
670
670
+
})
671
671
+
end
672
672
+
end,
673
673
+
block_end = function()
674
674
+
vim.schedule(function()
675
675
+
if saved_terminal then
676
676
+
saved_terminal:open()
677
677
+
saved_terminal = nil
678
678
+
end
679
679
+
end)
680
680
+
end,
681
681
+
},
682
682
+
window = {
683
683
+
open = "alternate",
684
684
+
},
685
685
+
})
686
686
+
'';
687
687
+
settings = {
688
688
+
size = 20;
689
689
+
open_mapping = "[[<C-x>]]";
690
690
+
direction = "horizontal";
691
691
+
start_in_insert = true;
692
692
+
insert_mappings = true;
693
693
+
terminal_mappings = true;
774
694
};
775
695
};
776
696
777
777
-
# none-ls = {
778
778
-
# enable = true;
779
779
-
# sources.formatting = {
780
780
-
# prettier = {
781
781
-
# enable = true;
782
782
-
# disableTsServerFormatter = true;
783
783
-
# };
784
784
-
# yamlfmt.enable = true;
785
785
-
# typstyle.enable = true;
786
786
-
# markdownlint.enable = true;
787
787
-
# };
788
788
-
# sources.diagnostics = {
789
789
-
# markdownlint.enable = true;
790
790
-
# };
791
791
-
# };
697
697
+
# Language Integration and LSPs
792
698
793
793
-
cmp = {
699
699
+
# Provider for syntax highlighting, symbols, etc. when not using an LSP
700
700
+
treesitter = {
794
701
enable = true;
702
702
+
luaConfig.post = lib.mkIf config.cow.dev.web ''
703
703
+
require('mdx').setup()
704
704
+
'';
795
705
settings = {
796
796
-
sources = map (name: {inherit name;}) [
797
797
-
"nvim_lsp"
798
798
-
"nvim_lsp_signature_help"
799
799
-
"path"
800
800
-
"buffer"
801
801
-
];
802
802
-
mapping = {
803
803
-
"<Esc>" = "cmp.mapping.abort()";
804
804
-
"<Tab>" = "cmp.mapping.confirm({ select = true })";
805
805
-
"<Up>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
806
806
-
"<Down>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
807
807
-
};
706
706
+
highlight.enable = true;
808
707
};
809
708
};
810
709
811
811
-
cmp-nvim-lsp.enable = true;
812
812
-
cmp-nvim-lsp-document-symbol.enable = true;
813
813
-
cmp-spell.enable = true;
814
814
-
815
815
-
rainbow-delimiters.enable = true;
816
816
-
preview.enable = true;
817
817
-
818
818
-
# jupytext.enable = true;
819
819
-
820
820
-
# Broken
821
821
-
# hex = {
822
822
-
# enable = true;
823
823
-
# settings = {
824
824
-
# assemble_cmd = "xxd -r";
825
825
-
# dump_cmd = "xxd -g 1 -u";
826
826
-
# };
827
827
-
# };
828
828
-
710
710
+
# Formatting code using multiple providers
829
711
conform-nvim = {
830
712
enable = true;
831
713
settings.default_format_opts = {
···
847
729
'';
848
730
};
849
731
732
732
+
# Common buffer type associations to activate LSPs
850
733
lspconfig.enable = true;
851
734
735
735
+
# UI for many LSP features
852
736
lspsaga = {
853
737
enable = true;
854
738
settings = {
···
873
757
};
874
758
};
875
759
876
876
-
crates.enable = true;
760
760
+
# Get latest version of deps in a Cargo.toml as inline hints
761
761
+
crates.enable = lib.mkDefault config.cow.dev.rust;
877
762
878
878
-
numbertoggle.enable = true;
763
763
+
# Misc. UI
879
764
880
880
-
# rustaceanvim.enable = true;
881
881
-
vim-css-color.enable = true;
765
765
+
# UI and provider for diagnostics
766
766
+
trouble = {
767
767
+
enable = true;
768
768
+
};
769
769
+
770
770
+
# Icons used in many places for languages
771
771
+
web-devicons.enable = true;
882
772
};
883
773
884
884
-
lsp = {
774
774
+
lsp = lib.mkDefault {
885
775
inlayHints.enable = true;
886
776
887
777
servers = let
···
902
792
# ghcPackage = pkgs.haskell.compiler.ghc912;
903
793
package = pkgs.haskell.packages.ghc912.haskell-language-server;
904
794
};
905
905
-
sqls.enable = web;
906
795
mdx_analyzer = lib.mkIf web {
907
796
enable = true;
908
797
package = pkgs.mdx-language-server;
909
798
};
910
910
-
# denols.enable = true;
911
799
ts_ls.enable = web;
912
800
html.enable = web;
913
801
marksman.enable = web;
···
916
804
yamlls.enable = web;
917
805
ruff.enable = python;
918
806
csharp_ls.enable = dotnet;
919
919
-
svelte.enable = web;
920
807
nil_ls.enable = true;
921
808
bashls.enable = true;
922
809
nushell.enable = config.cow.nushell.enable;
···
929
816
};
930
817
lemminx.enable = web;
931
818
eslint.enable = web;
932
932
-
just.enable = true;
819
819
+
just.enable = config.cow.utils.enable;
933
820
};
934
821
};
935
822
};
+9
-7
nixosModules/network.nix
···
46
46
services = lib.mkDefault {
47
47
resolved = {
48
48
enable = true;
49
49
-
llmnr = "false";
50
50
-
fallbackDns = [
51
51
-
"2606:4700:4700::1111"
52
52
-
"2606:4700:4700::1001"
53
53
-
"1.1.1.1"
54
54
-
"1.0.0.1"
55
55
-
];
49
49
+
settings.Resolve = {
50
50
+
LLMNR = "false";
51
51
+
FallbackDNS = [
52
52
+
"2606:4700:4700::1111"
53
53
+
"2606:4700:4700::1001"
54
54
+
"1.1.1.1"
55
55
+
"1.0.0.1"
56
56
+
];
57
57
+
};
56
58
};
57
59
timesyncd.servers = map (x: "time-${x}-g.nist.gov") [
58
60
"a"