-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneovim.nix
221 lines (209 loc) · 5.66 KB
/
neovim.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
inputs: {
lib,
pkgs,
...
}: {
home.packages = [pkgs.lazygit];
# Enable management of XDG base directories
xdg.enable = lib.mkDefault true;
xdg.configFile."nvim/lua/lsp-servers.lua".source = ./lua/lsp-servers.lua;
xdg.configFile."nvim/lua/lsp-settings.lua".source = ./lua/lsp-settings.lua;
xdg.configFile."nvim/lua/keymaps.lua".source = ./lua/keymaps.lua;
xdg.configFile."nvim/lua/options.lua".source = ./lua/options.lua;
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraLuaConfig =
# lua
''
require "options";
require "keymaps";
'';
extraPackages = with pkgs; [
# # Tools --
xclip
wl-clipboard
# # LSP --
nil
lua-language-server
typescript
typescript-language-server
vscode-langservers-extracted # html, css, json and eslint
tailwindcss-language-server
nodePackages.graphql-language-service-cli
# relay-compiler package overlay
myNodePackages.relay-compiler
emmet-language-server
emmet-ls
nginx-language-server
bash-language-server
# # Formatters --
prettierd
stylua
isort
black
shfmt
alejandra
# # Linters --
pylint
pyright
eslint_d
codespell
];
plugins = let
toLuaType = builtins.map (plugin: plugin // {type = "lua";});
import_cost-nvim = pkgs.vimUtils.buildVimPlugin {
name = "import_cost-nvim";
src = inputs.import_cost-nvim;
};
plain = with pkgs.vimPlugins; [
# Utils
plenary-nvim
dressing-nvim
nvim-web-devicons
vim-tmux-navigator
nui-nvim
# CMP
cmp-path
cmp-buffer
cmp-nvim-lsp
luasnip
cmp_luasnip
friendly-snippets
lspkind-nvim
lualine-lsp-progress
# otter-nvim
# Treesitter
nvim-ts-context-commentstring
nvim-ts-autotag
which-key-nvim
lazygit-nvim
nvim-surround
telescope-fzf-native-nvim
trouble-nvim
nvim-lsp-file-operations
import_cost-nvim
lazydev-nvim
noice-nvim
];
withConfig = with pkgs.vimPlugins; [
{
plugin = alpha-nvim;
config = lib.fileContents ./lua/plugins/alpha.lua;
}
{
plugin = auto-session;
config = lib.fileContents ./lua/plugins/auto-session.lua;
}
{
plugin = nvim-notify;
config = lib.fileContents ./lua/plugins/notify.lua;
}
{
plugin = nvim-autopairs;
config = lib.fileContents ./lua/plugins/autopairs.lua;
}
{
plugin = catppuccin-nvim;
config = lib.fileContents ./lua/plugins/catppuccin.lua;
}
{
plugin = nvim-cmp;
config = lib.fileContents ./lua/plugins/cmp.lua;
}
{
plugin = codesnap-nvim;
config = lib.fileContents ./lua/plugins/codesnap.lua;
}
{
plugin = comment-nvim;
config = lib.fileContents ./lua/plugins/comments.lua;
}
{
plugin = conform-nvim;
config = lib.fileContents ./lua/plugins/conform.lua;
}
{
plugin = hover-nvim;
config = lib.fileContents ./lua/plugins/hover.lua;
}
{
plugin = indent-blankline-nvim;
config = lib.fileContents ./lua/plugins/indent-blankline.lua;
}
{
plugin = nvim-lint;
config = lib.fileContents ./lua/plugins/lint.lua;
}
{
plugin = nvim-lspconfig;
config = lib.fileContents ./lua/plugins/lspconfig.lua;
}
{
plugin = lualine-nvim;
config = lib.fileContents ./lua/plugins/lualine.lua;
}
{
plugin = none-ls-nvim;
config = lib.fileContents ./lua/plugins/none-ls.lua;
}
{
plugin = telescope-nvim;
config = lib.fileContents ./lua/plugins/telescope.lua;
}
{
plugin = noice-nvim;
config = lib.fileContents ./lua/plugins/noice.lua;
}
{
plugin = todo-comments-nvim;
config = lib.fileContents ./lua/plugins/todo-comments.lua;
}
{
plugin = nvim-tree-lua;
config = lib.fileContents ./lua/plugins/nvim-tree.lua;
}
{
plugin = nvim-treesitter.withPlugins (p: [
p.tree-sitter-nix
p.tree-sitter-vim
p.tree-sitter-bash
p.tree-sitter-lua
p.tree-sitter-python
p.tree-sitter-json
p.tree-sitter-javascript
p.tree-sitter-typescript
p.tree-sitter-vue
p.tree-sitter-tsx
p.tree-sitter-yaml
p.tree-sitter-html
p.tree-sitter-css
p.tree-sitter-prisma
p.tree-sitter-markdown
p.tree-sitter-markdown-inline
p.tree-sitter-svelte
p.tree-sitter-graphql
p.tree-sitter-dockerfile
p.tree-sitter-gitignore
p.tree-sitter-query
p.tree-sitter-vimdoc
p.tree-sitter-c
p.tree-sitter-make
p.tree-sitter-cmake
(pkgs.tree-sitter.buildGrammar {
language = "nginx";
version = "unstable-2024-10-04";
src = inputs.tree-sitter-nginx;
})
]);
config = lib.fileContents ./lua/plugins/treesitter.lua;
}
];
in
plain
++ (toLuaType withConfig);
};
}