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
More Neovim Config!
bwc9876.dev
1 year ago
623a9bec
4a4049ab
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+208
-20
2 changed files
expand all
collapse all
unified
split
roles
dev
nvim.nix
graphics
apps.nix
+194
-20
roles/dev/nvim.nix
···
26
26
settings.flavor = config.catppuccin.flavor;
27
27
};
28
28
29
29
+
autoGroups = {
30
30
+
restore_cursor = {};
31
31
+
};
32
32
+
33
33
+
opts = {
34
34
+
number = true;
35
35
+
smartindent = true;
36
36
+
cursorline = true;
37
37
+
showtabline = 2;
38
38
+
breakindent = true;
39
39
+
foldenable = true;
40
40
+
};
41
41
+
42
42
+
autoCmd = [
43
43
+
{
44
44
+
group = "restore_cursor";
45
45
+
event = ["BufReadPost"];
46
46
+
pattern = "*";
47
47
+
callback = {
48
48
+
__raw = ''
49
49
+
function()
50
50
+
if
51
51
+
vim.fn.line "'\"" > 1
52
52
+
and vim.fn.line "'\"" <= vim.fn.line "$"
53
53
+
and vim.bo.filetype ~= "commit"
54
54
+
and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1
55
55
+
then
56
56
+
vim.cmd "normal! g`\""
57
57
+
end
58
58
+
end
59
59
+
'';
60
60
+
};
61
61
+
}
62
62
+
];
63
63
+
29
64
performance = {
30
65
byteCompileLua = {
31
66
enable = true;
32
67
nvimRuntime = true;
33
33
-
plugins = true;
68
68
+
plugins = false;
34
69
};
35
70
combinePlugins = {
36
71
enable = true;
72
72
+
standalonePlugins = ["telescope-nvim"];
37
73
};
38
74
};
39
75
···
43
79
key = "<C-.>";
44
80
options.desc = "Open Code Actions";
45
81
}
82
82
+
{
83
83
+
action = "<cmd>Telescope<cr>";
84
84
+
key = "<leader><leader>";
85
85
+
options.desc = "Telescope Launch";
86
86
+
}
87
87
+
{
88
88
+
action = "<cmd>Navbuddy<cr>";
89
89
+
key = "<leader>j";
90
90
+
options.desc = "Jump To...";
91
91
+
}
46
92
];
47
93
48
94
plugins = {
···
53
99
};
54
100
extensions = {
55
101
file-browser.enable = true;
56
56
-
frecency.enable = true;
57
102
ui-select.enable = true;
58
103
};
59
59
-
keymaps = {
60
60
-
"<leader>ff" = {
104
104
+
keymaps = lib.fix (self: {
105
105
+
"<leader>p" = {
106
106
+
action = "projects";
107
107
+
options.desc = "Projects";
108
108
+
};
109
109
+
"<leader>c" = {
110
110
+
action = "commands";
111
111
+
options.desc = "Browse Commands";
112
112
+
};
113
113
+
"<leader>x" = {
114
114
+
action = "keymaps";
115
115
+
options.desc = "Keymaps";
116
116
+
};
117
117
+
"<leader>w" = {
118
118
+
action = "spell_suggest";
119
119
+
options.desc = "Spell Suggest";
120
120
+
};
121
121
+
"<leader>s" = {
122
122
+
action = "treesitter";
123
123
+
options.desc = "Treesitter Symbols";
124
124
+
};
125
125
+
"<leader>b" = {
126
126
+
action = "file_browser";
127
127
+
options.desc = "File Browser";
128
128
+
};
129
129
+
"<leader>f" = {
61
130
action = "find_files";
62
62
-
options.desc = "Find files with Telescope";
131
131
+
options.desc = "Files";
63
132
};
64
64
-
"<leader>fr" = {
65
65
-
action = "frecency";
66
66
-
options.desc = "Open Recently Edited File";
67
67
-
};
68
68
-
"<leader>fgs" = {
133
133
+
"<leader>gs" = {
69
134
action = "git_status";
70
70
-
options.desc = "Get Git Status";
135
135
+
options.desc = "Git Status";
71
136
};
72
72
-
"<leader>fgb" = {
137
137
+
"<leader>gb" = {
73
138
action = "git_branches";
74
74
-
options.desc = "View Git Branches";
139
139
+
options.desc = "Git Branches";
75
140
};
76
76
-
"<leader>fgc" = {
141
141
+
"<leader>gc" = {
77
142
action = "git_commits";
78
78
-
options.desc = "View Git Commits";
143
143
+
options.desc = "Git Commits";
79
144
};
145
145
+
"<leader>r" = {
146
146
+
action = "oldfiles";
147
147
+
options.desc = "Recent Files";
148
148
+
};
149
149
+
150
150
+
"<leader>l" = self."<C-S-F>";
80
151
"<C-S-F>" = {
81
152
action = "live_grep";
82
153
options.desc = "Live Grep";
83
154
};
84
84
-
};
155
155
+
});
85
156
};
86
157
87
87
-
dashboard.enable = true;
158
158
+
alpha = {
159
159
+
enable = true;
160
160
+
opts = {
161
161
+
position = "center";
162
162
+
};
163
163
+
layout = let
164
164
+
o = {position = "center";};
165
165
+
txt = s: {
166
166
+
type = "text";
167
167
+
val = s;
168
168
+
opts = {hl = "Keyword";} // o;
169
169
+
};
170
170
+
grp = g: {
171
171
+
type = "group";
172
172
+
val = g;
173
173
+
opts.spacing = 1;
174
174
+
};
175
175
+
btn = {
176
176
+
val,
177
177
+
onClick,
178
178
+
...
179
179
+
}: {
180
180
+
type = "button";
181
181
+
inherit val;
182
182
+
opts = o;
183
183
+
on_press.__raw = "function() vim.cmd[[${onClick}]] end";
184
184
+
};
185
185
+
cmd = {
186
186
+
command,
187
187
+
width,
188
188
+
height,
189
189
+
}: {
190
190
+
type = "terminal";
191
191
+
inherit command width height;
192
192
+
opts = o;
193
193
+
};
194
194
+
pad = {
195
195
+
type = "padding";
196
196
+
val = 2;
197
197
+
};
198
198
+
in
199
199
+
[pad pad pad]
200
200
+
++ (lib.intersperse pad [
201
201
+
(let
202
202
+
banner = pkgs.runCommand "nvim-banner" {} ''${pkgs.toilet}/bin/toilet " NIXVIM " -f mono12 -F border > $out'';
203
203
+
bannerText = builtins.readFile banner;
204
204
+
in
205
205
+
cmd {
206
206
+
command = ''mut i = 1; loop { let s = (open ${banner}) | ${pkgs.lolcat}/bin/lolcat -f -S $i; clear; print -n -r $s; sleep 100ms; $i += 3; }'';
207
207
+
width = (builtins.stringLength (lib.trim (builtins.elemAt (lib.splitString "\n" bannerText) 1))) - 3;
208
208
+
height = (builtins.length (lib.splitString "\n" bannerText)) - 1;
209
209
+
})
210
210
+
(grp [
211
211
+
(btn {
212
212
+
val = " Open Project";
213
213
+
onClick = "Telescope projects";
214
214
+
shortcut = "<leader>p";
215
215
+
})
216
216
+
(btn {
217
217
+
val = " Open Recent File";
218
218
+
onClick = "Telescope oldfiles";
219
219
+
shortcut = "<leader>r";
220
220
+
})
221
221
+
(btn {
222
222
+
val = " Quit";
223
223
+
onClick = "q";
224
224
+
shortcut = "q";
225
225
+
})
226
226
+
])
227
227
+
(txt "::<シ>")
228
228
+
])
229
229
+
++ [pad];
230
230
+
};
88
231
89
232
trouble = {
90
233
enable = true;
···
103
246
104
247
treesitter = {
105
248
enable = true;
106
106
-
settings.highlight.enable = true;
249
249
+
settings = {
250
250
+
highlight.enable = true;
251
251
+
folding.enable = true;
252
252
+
};
107
253
};
108
254
109
255
illuminate.enable = true;
110
256
cursorline.enable = true;
111
257
112
112
-
neocord.enable = true;
258
258
+
navbuddy = {
259
259
+
enable = true;
260
260
+
lsp.autoAttach = true;
261
261
+
mappings = {
262
262
+
"<Left>" = "parent";
263
263
+
"<Right>" = "children";
264
264
+
"<Up>" = "previous_sibling";
265
265
+
"<Down>" = "next_sibling";
266
266
+
"<C-Left>" = "root";
267
267
+
};
268
268
+
};
269
269
+
270
270
+
neocord = {
271
271
+
enable = true;
272
272
+
settings.logo = "https://raw.githubusercontent.com/IogaMaster/neovim/main/.github/assets/nixvim-dark.webp";
273
273
+
};
113
274
114
275
barbar = {
115
276
enable = true;
···
121
282
};
122
283
};
123
284
285
285
+
statuscol = {
286
286
+
enable = true;
287
287
+
};
288
288
+
289
289
+
lualine = {
290
290
+
enable = true;
291
291
+
settings = {
292
292
+
extensions = [
293
293
+
"trouble"
294
294
+
"toggleterm"
295
295
+
];
296
296
+
};
297
297
+
};
298
298
+
124
299
project-nvim = {
125
300
enable = true;
126
301
enableTelescope = true;
···
129
304
web-devicons.enable = true;
130
305
131
306
guess-indent.enable = true;
132
132
-
indent-blankline.enable = true;
133
307
intellitab.enable = true;
134
308
135
309
which-key = {
+14
roles/graphics/apps.nix
···
8
8
Icon=htop
9
9
'';
10
10
11
11
+
programs.kdeconnect.enable = true;
12
12
+
13
13
+
systemd.user.services.kdeconnect = {
14
14
+
description = "Adds communication between your desktop and your smartphone";
15
15
+
after = ["graphical-session-pre.target"];
16
16
+
partOf = ["graphical-session.target"];
17
17
+
wantedBy = ["graphical-session.target"];
18
18
+
serviceConfig = {
19
19
+
# Environment = "PATH=${config.home.profileDirectory}/bin";
20
20
+
ExecStart = "${pkgs.libsForQt5.kdeconnect-kde}/libexec/kdeconnectd";
21
21
+
Restart = "on-abort";
22
22
+
};
23
23
+
};
24
24
+
11
25
environment.systemPackages = with pkgs; [
12
26
chromium
13
27