1{ lib
2, stdenv
3
4 # nixpkgs functions
5, buildGoModule
6, buildVimPluginFrom2Nix
7, fetchFromGitHub
8, fetchpatch
9, fetchurl
10, substituteAll
11
12 # Language dependencies
13, python
14, python3
15, rustPlatform
16
17 # Misc dependencies
18, Cocoa
19, code-minimap
20, dasht
21, direnv
22, fzf
23, gnome
24, himalaya
25, khard
26, languagetool
27, llvmPackages
28, meson
29, nim
30, nodePackages
31, skim
32, sqlite
33, statix
34, stylish-haskell
35, tabnine
36, vim
37, which
38, xkb-switch
39, ycmd
40, nodejs
41
42# test dependencies
43, neovim-unwrapped
44
45 # command-t dependencies
46, rake
47, ruby
48
49 # cpsm dependencies
50, boost
51, cmake
52, icu
53, ncurses
54
55 # LanguageClient-neovim dependencies
56, CoreFoundation
57, CoreServices
58
59 # nvim-treesitter dependencies
60, tree-sitter
61
62 # sved dependencies
63, glib
64, gobject-introspection
65, wrapGAppsHook
66
67 # vim-clap dependencies
68, curl
69, libgit2
70, libiconv
71, openssl
72, pkg-config
73
74 # vim-go dependencies
75, asmfmt
76, delve
77, errcheck
78, gnused
79, go-motion
80, go-tools
81, gocode
82, gocode-gomod
83, godef
84, gogetdoc
85, golangci-lint
86, golint
87, gomodifytags
88, gopls
89, gotags
90, gotools
91, iferr
92, impl
93, reftools
94 # must be lua51Packages
95, luaPackages
96}:
97
98self: super: {
99
100 clang_complete = super.clang_complete.overrideAttrs (old: {
101 # In addition to the arguments you pass to your compiler, you also need to
102 # specify the path of the C++ std header (if you are using C++).
103 # These usually implicitly set by cc-wrapper around clang (pkgs/build-support/cc-wrapper).
104 # The linked ruby code shows generates the required '.clang_complete' for cmake based projects
105 # https://gist.github.com/Mic92/135e83803ed29162817fce4098dec144
106 preFixup = ''
107 substituteInPlace "$out"/plugin/clang_complete.vim \
108 --replace "let g:clang_library_path = '' + "''" + ''" "let g:clang_library_path='${llvmPackages.libclang.lib}/lib/libclang.so'"
109
110 substituteInPlace "$out"/plugin/libclang.py \
111 --replace "/usr/lib/clang" "${llvmPackages.clang.cc}/lib/clang"
112 '';
113 });
114
115 clighter8 = super.clighter8.overrideAttrs (old: {
116 preFixup = ''
117 sed "/^let g:clighter8_libclang_path/s|')$|${llvmPackages.clang.cc.lib}/lib/libclang.so')|" \
118 -i "$out"/plugin/clighter8.vim
119 '';
120 });
121
122 cmp-tabnine = super.cmp-tabnine.overrideAttrs (old: {
123 buildInputs = [ tabnine ];
124
125 postFixup = ''
126 mkdir -p $target/binaries/${tabnine.version}
127 ln -s ${tabnine}/bin/ $target/binaries/${tabnine.version}/${tabnine.passthru.platform}
128 '';
129 });
130
131 command-t = super.command-t.overrideAttrs (old: {
132 buildInputs = [ ruby rake ];
133 buildPhase = ''
134 rake make
135 rm ruby/command-t/ext/command-t/*.o
136 '';
137 });
138
139 compe-tabnine = super.compe-tabnine.overrideAttrs (old: {
140 buildInputs = [ tabnine ];
141
142 postFixup = ''
143 mkdir -p $target/binaries/${tabnine.version}
144 ln -s ${tabnine}/bin/ $target/binaries/${tabnine.version}/${tabnine.passthru.platform}
145 '';
146 });
147
148 completion-buffers = super.completion-buffers.overrideAttrs (old: {
149 dependencies = with self; [ completion-nvim ];
150 });
151
152 completion-tabnine = super.completion-tabnine.overrideAttrs (old: {
153 dependencies = with self; [ completion-nvim ];
154 buildInputs = [ tabnine ];
155 postFixup = ''
156 mkdir -p $target/binaries
157 ln -s ${tabnine}/bin/TabNine $target/binaries/TabNine_$(uname -s)
158 '';
159 });
160
161 completion-treesitter = super.completion-treesitter.overrideAttrs (old: {
162 dependencies = with self; [ completion-nvim nvim-treesitter ];
163 });
164
165 cpsm = super.cpsm.overrideAttrs (old: {
166 buildInputs = [
167 python3
168 stdenv
169 cmake
170 boost
171 icu
172 ncurses
173 ];
174 buildPhase = ''
175 patchShebangs .
176 export PY3=ON
177 ./install.sh
178 '';
179 });
180
181 crates-nvim = super.crates-nvim.overrideAttrs (old: {
182 dependencies = with self; [ plenary-nvim ];
183 });
184
185 ctrlp-cmatcher = super.ctrlp-cmatcher.overrideAttrs (old: {
186 buildInputs = [ python ];
187 buildPhase = ''
188 patchShebangs .
189 ./install.sh
190 '';
191 });
192
193 defx-nvim = super.defx-nvim.overrideAttrs (old: {
194 dependencies = with self; [ nvim-yarp ];
195 });
196
197 deoplete-fish = super.deoplete-fish.overrideAttrs (old: {
198 dependencies = with self; [ deoplete-nvim vim-fish ];
199 });
200
201 deoplete-go = super.deoplete-go.overrideAttrs (old: {
202 buildInputs = [ python3 ];
203 buildPhase = ''
204 pushd ./rplugin/python3/deoplete/ujson
205 python3 setup.py build --build-base=$PWD/build --build-lib=$PWD/build
206 popd
207 find ./rplugin/ -name "ujson*.so" -exec mv -v {} ./rplugin/python3/ \;
208 '';
209 });
210
211 deoplete-khard = super.deoplete-khard.overrideAttrs (old: {
212 dependencies = with self; [ deoplete-nvim ];
213 passthru.python3Dependencies = ps: [ (ps.toPythonModule khard) ];
214 meta = {
215 description = "Address-completion for khard via deoplete";
216 homepage = "https://github.com/nicoe/deoplete-khard";
217 license = lib.licenses.mit;
218 maintainers = with lib.maintainers; [ jorsn ];
219 };
220 });
221
222 direnv-vim = super.direnv-vim.overrideAttrs (oa: {
223 preFixup = oa.preFixup or "" + ''
224 substituteInPlace $out/autoload/direnv.vim \
225 --replace "let s:direnv_cmd = get(g:, 'direnv_cmd', 'direnv')" \
226 "let s:direnv_cmd = get(g:, 'direnv_cmd', '${lib.getBin direnv}/bin/direnv')"
227 '';
228 });
229
230 ensime-vim = super.ensime-vim.overrideAttrs (old: {
231 passthru.python3Dependencies = ps: with ps; [ sexpdata websocket-client ];
232 dependencies = with self; [ vimproc-vim vimshell-vim self.self forms ];
233 });
234
235 fcitx-vim = super.fcitx-vim.overrideAttrs (old: {
236 passthru.python3Dependencies = ps: with ps; [ dbus-python ];
237 meta = {
238 description = "Keep and restore fcitx state when leaving/re-entering insert mode or search mode";
239 license = lib.licenses.mit;
240 };
241 });
242
243 forms = super.forms.overrideAttrs (old: {
244 dependencies = with self; [ self.self ];
245 });
246
247 fruzzy =
248 let
249 # until https://github.com/NixOS/nixpkgs/pull/67878 is merged, there's no better way to install nim libraries with nix
250 nimpy = fetchFromGitHub {
251 owner = "yglukhov";
252 repo = "nimpy";
253 rev = "4840d1e438985af759ddf0923e7a9250fd8ea0da";
254 sha256 = "0qqklvaajjqnlqm3rkk36pwwnn7x942mbca7nf2cvryh36yg4q5k";
255 };
256 binaryheap = fetchFromGitHub {
257 owner = "bluenote10";
258 repo = "nim-heap";
259 rev = "c38039309cb11391112571aa332df9c55f625b54";
260 sha256 = "05xdy13vm5n8dw2i366ppbznc4cfhq23rdcklisbaklz2jhdx352";
261 };
262 in
263 super.fruzzy.overrideAttrs (old: {
264 buildInputs = [ nim ];
265 patches = [
266 (substituteAll {
267 src = ./patches/fruzzy/get_version.patch;
268 version = old.version;
269 })
270 ];
271 configurePhase = ''
272 substituteInPlace Makefile \
273 --replace \
274 "nim c" \
275 "nim c --nimcache:$TMP --path:${nimpy} --path:${binaryheap}"
276 '';
277 buildPhase = ''
278 make build
279 '';
280 });
281
282 fzf-checkout-vim = super.fzf-checkout-vim.overrideAttrs (old: {
283 # The plugin has a makefile which tries to run tests in a docker container.
284 # This prevents it.
285 prePatch = ''
286 rm Makefile
287 '';
288 });
289
290 fzf-vim = super.fzf-vim.overrideAttrs (old: {
291 dependencies = with self; [ fzfWrapper ];
292 });
293
294 # Mainly used as a dependency for fzf-vim. Wraps the fzf program as a vim
295 # plugin, since part of the fzf vim plugin is included in the main fzf
296 # program.
297 fzfWrapper = buildVimPluginFrom2Nix {
298 inherit (fzf) src version;
299 pname = "fzf";
300 postInstall = ''
301 ln -s ${fzf}/bin/fzf $target/bin/fzf
302 '';
303 };
304
305 ghcid = super.ghcid.overrideAttrs (old: {
306 configurePhase = "cd plugins/nvim";
307 });
308
309 gitsigns-nvim = super.gitsigns-nvim.overrideAttrs (old: {
310 dependencies = with self; [ plenary-nvim ];
311 });
312
313 # plenary-nvim = super.toVimPlugin(luaPackages.plenary-nvim);
314
315 gruvbox-nvim = super.gruvbox-nvim.overrideAttrs (old: {
316 dependencies = with self; [ lush-nvim ];
317 });
318
319 jedi-vim = super.jedi-vim.overrideAttrs (old: {
320 # checking for python3 support in vim would be neat, too, but nobody else seems to care
321 buildInputs = [ python3.pkgs.jedi ];
322 meta = {
323 description = "code-completion for python using python-jedi";
324 license = lib.licenses.mit;
325 };
326 });
327
328 himalaya-vim = buildVimPluginFrom2Nix {
329 pname = "himalaya-vim";
330 inherit (himalaya) src version;
331 dependencies = with self; [ himalaya ];
332 configurePhase = ''
333 cd vim
334 substituteInPlace plugin/himalaya.vim \
335 --replace 'if !executable("himalaya")' 'if v:false'
336 '';
337 postFixup = ''
338 mkdir -p $out/bin
339 ln -s ${himalaya}/bin/himalaya $out/bin/himalaya
340 '';
341 };
342
343 LanguageClient-neovim =
344 let
345 version = "0.1.161";
346 LanguageClient-neovim-src = fetchFromGitHub {
347 owner = "autozimu";
348 repo = "LanguageClient-neovim";
349 rev = version;
350 sha256 = "Z9S2ie9RxJCIbmjSV/Tto4lK04cZfWmK3IAy8YaySVI=";
351 };
352 LanguageClient-neovim-bin = rustPlatform.buildRustPackage {
353 pname = "LanguageClient-neovim-bin";
354 inherit version;
355 src = LanguageClient-neovim-src;
356
357 cargoSha256 = "H34UqJ6JOwuSABdOup5yKeIwFrGc83TUnw1ggJEx9o4=";
358 buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
359
360 # FIXME: Use impure version of CoreFoundation because of missing symbols.
361 # Undefined symbols for architecture x86_64: "_CFURLResourceIsReachable"
362 preConfigure = lib.optionalString stdenv.isDarwin ''
363 export NIX_LDFLAGS="-F${CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS"
364 '';
365 };
366 in
367 buildVimPluginFrom2Nix {
368 pname = "LanguageClient-neovim";
369 inherit version;
370 src = LanguageClient-neovim-src;
371
372 propagatedBuildInputs = [ LanguageClient-neovim-bin ];
373
374 preFixup = ''
375 substituteInPlace "$out"/autoload/LanguageClient.vim \
376 --replace "let l:path = s:root . '/bin/'" "let l:path = '${LanguageClient-neovim-bin}' . '/bin/'"
377 '';
378 };
379
380 lean-nvim = super.lean-nvim.overrideAttrs (old: {
381 dependencies = with self; [ nvim-lspconfig plenary-nvim ];
382 });
383
384 lens-vim = super.lens-vim.overrideAttrs (old: {
385 # remove duplicate g:lens#animate in doc/lens.txt
386 # https://github.com/NixOS/nixpkgs/pull/105810#issuecomment-740007985
387 # https://github.com/camspiers/lens.vim/pull/40/files
388 patches = [
389 (substituteAll {
390 src = ./patches/lens-vim/remove_duplicate_g_lens_animate.patch;
391 inherit languagetool;
392 })
393 ];
394 });
395
396 lf-vim = super.lf-vim.overrideAttrs (old: {
397 dependencies = with self; [ vim-floaterm ];
398 });
399
400 lir-nvim = super.lir-nvim.overrideAttrs (old: {
401 dependencies = with self; [ plenary-nvim ];
402 });
403
404 markdown-preview-nvim = super.markdown-preview-nvim.overrideAttrs (old: let
405 # We only need its dependencies `node-modules`.
406 nodeDep = nodePackages."markdown-preview-nvim-../../misc/vim-plugins/markdown-preview-nvim".overrideAttrs (old: {
407 dontNpmInstall = true;
408 });
409 in {
410 patches = [
411 (substituteAll {
412 src = ./markdown-preview-nvim/fix-node-paths.patch;
413 node = "${nodejs}/bin/node";
414 })
415 ];
416 postInstall = ''
417 # The node package name is `*-vim` not `*-nvim`.
418 ln -s ${nodeDep}/lib/node_modules/markdown-preview-vim/node_modules $out/app
419 '';
420
421 nativeBuildInputs = [ nodejs ];
422 doInstallCheck = true;
423 installCheckPhase = ''
424 node $out/app/index.js --version
425 '';
426 });
427
428 meson = buildVimPluginFrom2Nix {
429 inherit (meson) pname version src;
430 preInstall = "cd data/syntax-highlighting/vim";
431 meta.maintainers = with lib.maintainers; [ vcunat ];
432 };
433
434 minimap-vim = super.minimap-vim.overrideAttrs (old: {
435 preFixup = ''
436 substituteInPlace $out/plugin/minimap.vim \
437 --replace "code-minimap" "${code-minimap}/bin/code-minimap"
438 substituteInPlace $out/bin/minimap_generator.sh \
439 --replace "code-minimap" "${code-minimap}/bin/code-minimap"
440 '';
441
442 doCheck = true;
443 checkPhase = ''
444 ${neovim-unwrapped}/bin/nvim -n -u NONE -i NONE -V1 --cmd "set rtp+=$out" --cmd "runtime! plugin/*.vim" -c "MinimapToggle" +quit!
445 '';
446
447 });
448
449 ncm2 = super.ncm2.overrideAttrs (old: {
450 dependencies = with self; [ nvim-yarp ];
451 });
452
453 ncm2-jedi = super.ncm2-jedi.overrideAttrs (old: {
454 dependencies = with self; [ nvim-yarp ncm2 ];
455 passthru.python3Dependencies = ps: with ps; [ jedi ];
456 });
457
458 ncm2-neoinclude = super.ncm2-neoinclude.overrideAttrs (old: {
459 dependencies = with self; [ neoinclude-vim ];
460 });
461
462 ncm2-neosnippet = super.ncm2-neosnippet.overrideAttrs (old: {
463 dependencies = with self; [ neosnippet-vim ];
464 });
465
466 ncm2-syntax = super.ncm2-syntax.overrideAttrs (old: {
467 dependencies = with self; [ neco-syntax ];
468 });
469
470 ncm2-ultisnips = super.ncm2-ultisnips.overrideAttrs (old: {
471 dependencies = with self; [ ultisnips ];
472 });
473
474 neogit = super.neogit.overrideAttrs (old: {
475 dependencies = with self; [ plenary-nvim ];
476 });
477
478 null-ls-nvim = super.null-ls-nvim.overrideAttrs (old: {
479 dependencies = with self; [ plenary-nvim nvim-lspconfig ];
480 });
481
482 nvim-lsputils = super.nvim-lsputils.overrideAttrs (old: {
483 dependencies = with self; [ popfix ];
484 });
485
486 nvim-spectre = super.nvim-spectre.overrideAttrs (old: {
487 dependencies = with self; [ plenary-nvim ];
488 });
489
490 # Usage:
491 # pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ p.tree-sitter-c p.tree-sitter-java ... ])
492 # or for all grammars:
493 # pkgs.vimPlugins.nvim-treesitter.withPlugins (_: tree-sitter.allGrammars)
494 nvim-treesitter = super.nvim-treesitter.overrideAttrs (old: {
495 passthru.withPlugins =
496 grammarFn: self.nvim-treesitter.overrideAttrs (_: {
497 postPatch =
498 let
499 grammars = tree-sitter.withPlugins grammarFn;
500 in
501 ''
502 rm -r parser
503 ln -s ${grammars} parser
504 '';
505 });
506 });
507
508 onehalf = super.onehalf.overrideAttrs (old: {
509 configurePhase = "cd vim";
510 });
511
512 range-highlight-nvim = super.range-highlight-nvim.overrideAttrs (old: {
513 dependencies = with self; [ cmd-parser-nvim ];
514 });
515
516 refactoring-nvim = super.refactoring-nvim.overrideAttrs (old: {
517 dependencies = with self; [ nvim-treesitter plenary-nvim ];
518 });
519
520 skim = buildVimPluginFrom2Nix {
521 pname = "skim";
522 version = skim.version;
523 src = skim.vim;
524 };
525
526 skim-vim = super.skim-vim.overrideAttrs (old: {
527 dependencies = with self; [ skim ];
528 });
529
530 sqlite-lua = super.sqlite-lua.overrideAttrs (old: {
531 postPatch = let
532 libsqlite = "${sqlite.out}/lib/libsqlite3${stdenv.hostPlatform.extensions.sharedLibrary}";
533 in ''
534 substituteInPlace lua/sqlite/defs.lua \
535 --replace "path = vim.g.sqlite_clib_path" "path = vim.g.sqlite_clib_path or ${lib.escapeShellArg libsqlite}"
536 '';
537 });
538
539 statix = buildVimPluginFrom2Nix rec {
540 inherit (statix) pname src meta;
541 version = "0.1.0";
542 dependencies = with self; [ statix ];
543 postPatch = ''
544 # check that version is up to date
545 grep 'pname = "statix-vim"' -A 1 flake.nix \
546 | grep -F 'version = "${version}"'
547
548 cd vim-plugin
549 substituteInPlace ftplugin/nix.vim --replace statix ${statix}/bin/statix
550 substituteInPlace plugin/statix.vim --replace statix ${statix}/bin/statix
551 '';
552 };
553
554 sved =
555 let
556 # we put the script in its own derivation to benefit the magic of wrapGAppsHook
557 svedbackend = stdenv.mkDerivation {
558 name = "svedbackend-${super.sved.name}";
559 inherit (super.sved) src;
560 nativeBuildInputs = [ wrapGAppsHook ];
561 buildInputs = [
562 gobject-introspection
563 glib
564 (python3.withPackages (ps: with ps; [ pygobject3 pynvim dbus-python ]))
565 ];
566 preferLocalBuild = true;
567 installPhase = ''
568 install -Dt $out/bin ftplugin/evinceSync.py
569 '';
570 };
571 in
572 super.sved.overrideAttrs (old: {
573 preferLocalBuild = true;
574 postPatch = ''
575 rm ftplugin/evinceSync.py
576 ln -s ${svedbackend}/bin/evinceSync.py ftplugin/evinceSync.py
577 '';
578 meta = {
579 description = "synctex support between vim/neovim and evince";
580 };
581 });
582
583 telescope-cheat-nvim = super.telescope-cheat-nvim.overrideAttrs (old: {
584 dependencies = with self; [ sqlite-lua telescope-nvim ];
585 });
586
587 telescope-frecency-nvim = super.telescope-frecency-nvim.overrideAttrs (old: {
588 dependencies = with self; [ sqlite-lua telescope-nvim ];
589 });
590
591 telescope-fzf-writer-nvim = super.telescope-fzf-writer-nvim.overrideAttrs (old: {
592 dependencies = with self; [ telescope-nvim ];
593 });
594
595 telescope-fzf-native-nvim = super.telescope-fzf-native-nvim.overrideAttrs (old: {
596 dependencies = with self; [ telescope-nvim ];
597 buildPhase = "make";
598 meta.platforms = lib.platforms.all;
599 });
600
601 telescope-fzy-native-nvim = super.telescope-fzy-native-nvim.overrideAttrs (old: {
602 dependencies = with self; [ telescope-nvim ];
603 preFixup =
604 let
605 fzy-lua-native-path = "deps/fzy-lua-native";
606 fzy-lua-native =
607 stdenv.mkDerivation {
608 name = "fzy-lua-native";
609 src = "${old.src}/${fzy-lua-native-path}";
610 # remove pre-compiled binaries
611 preBuild = "rm -rf static/*";
612 installPhase = ''
613 install -Dm 444 -t $out/static static/*
614 install -Dm 444 -t $out/lua lua/*
615 '';
616 };
617 in
618 ''
619 rm -rf $target/${fzy-lua-native-path}/*
620 ln -s ${fzy-lua-native}/static $target/${fzy-lua-native-path}/static
621 ln -s ${fzy-lua-native}/lua $target/${fzy-lua-native-path}/lua
622 '';
623 meta.platforms = lib.platforms.all;
624 });
625
626 telescope-nvim = super.telescope-nvim.overrideAttrs (old: {
627 dependencies = with self; [ plenary-nvim popup-nvim ];
628 });
629
630 telescope-symbols-nvim = super.telescope-symbols-nvim.overrideAttrs (old: {
631 dependencies = with self; [ telescope-nvim ];
632 });
633
634 telescope-z-nvim = super.telescope-z-nvim.overrideAttrs (old: {
635 dependencies = with self; [ telescope-nvim ];
636 });
637
638 unicode-vim =
639 let
640 unicode-data = fetchurl {
641 url = "http://www.unicode.org/Public/UNIDATA/UnicodeData.txt";
642 sha256 = "16b0jzvvzarnlxdvs2izd5ia0ipbd87md143dc6lv6xpdqcs75s9";
643 };
644 in
645 super.unicode-vim.overrideAttrs (old: {
646
647 # redirect to /dev/null else changes terminal color
648 buildPhase = ''
649 cp "${unicode-data}" autoload/unicode/UnicodeData.txt
650 echo "Building unicode cache"
651 ${vim}/bin/vim --cmd ":set rtp^=$PWD" -c 'ru plugin/unicode.vim' -c 'UnicodeCache' -c ':echohl Normal' -c ':q' > /dev/null
652 '';
653 });
654
655 vCoolor-vim = super.vCoolor-vim.overrideAttrs (old: {
656 # on linux can use either Zenity or Yad.
657 propagatedBuildInputs = [ gnome.zenity ];
658 meta = {
659 description = "Simple color selector/picker plugin";
660 license = lib.licenses.publicDomain;
661 };
662 });
663
664 vim-addon-actions = super.vim-addon-actions.overrideAttrs (old: {
665 dependencies = with self; [ vim-addon-mw-utils tlib_vim ];
666 });
667
668 vim-addon-async = super.vim-addon-async.overrideAttrs (old: {
669 dependencies = with self; [ vim-addon-signs ];
670 });
671
672 vim-addon-background-cmd = super.vim-addon-background-cmd.overrideAttrs (old: {
673 dependencies = with self; [ vim-addon-mw-utils ];
674 });
675
676 vim-addon-completion = super.vim-addon-completion.overrideAttrs (old: {
677 dependencies = with self; [ tlib_vim ];
678 });
679
680 vim-addon-goto-thing-at-cursor = super.vim-addon-goto-thing-at-cursor.overrideAttrs (old: {
681 dependencies = with self; [ tlib_vim ];
682 });
683
684 vim-addon-manager = super.vim-addon-manager.overrideAttrs (old: {
685 buildInputs = lib.optional stdenv.isDarwin Cocoa;
686 });
687
688 vim-addon-mru = super.vim-addon-mru.overrideAttrs (old: {
689 dependencies = with self; [ vim-addon-other vim-addon-mw-utils ];
690 });
691
692 vim-addon-nix = super.vim-addon-nix.overrideAttrs (old: {
693 dependencies = with self; [
694 vim-addon-completion
695 vim-addon-goto-thing-at-cursor
696 vim-addon-errorformats
697 vim-addon-actions
698 vim-addon-mw-utils
699 tlib_vim
700 ];
701 });
702
703 vim-addon-sql = super.vim-addon-sql.overrideAttrs (old: {
704 dependencies = with self; [ vim-addon-completion vim-addon-background-cmd tlib_vim ];
705 });
706
707 vim-addon-syntax-checker = super.vim-addon-syntax-checker.overrideAttrs (old: {
708 dependencies = with self; [ vim-addon-mw-utils tlib_vim ];
709 });
710
711 vim-addon-toggle-buffer = super.vim-addon-toggle-buffer.overrideAttrs (old: {
712 dependencies = with self; [ vim-addon-mw-utils tlib_vim ];
713 });
714
715 vim-addon-xdebug = super.vim-addon-xdebug.overrideAttrs (old: {
716 dependencies = with self; [ webapi-vim vim-addon-mw-utils vim-addon-signs vim-addon-async ];
717 });
718
719 vim-bazel = super.vim-bazel.overrideAttrs (old: {
720 dependencies = with self; [ vim-maktaba ];
721 });
722
723 vim-beancount = super.vim-beancount.overrideAttrs (old: {
724 passthru.python3Dependencies = ps: with ps; [ beancount ];
725 });
726
727 vim-clap = super.vim-clap.overrideAttrs (old: {
728 preFixup =
729 let
730 maple-bin = rustPlatform.buildRustPackage {
731 name = "maple";
732 src = old.src;
733
734 nativeBuildInputs = [
735 pkg-config
736 ];
737
738 buildInputs = [
739 openssl
740 ] ++ lib.optionals stdenv.isDarwin [
741 CoreServices
742 curl
743 libgit2
744 libiconv
745 ];
746
747 cargoSha256 = "sha256-DiCQpgyz0iNEm6gjaJU5IGdsQISHhPqlDQBzZafngjY=";
748 };
749 in
750 ''
751 ln -s ${maple-bin}/bin/maple $target/bin/maple
752 '';
753
754 meta.platforms = lib.platforms.all;
755 });
756
757 vim-codefmt = super.vim-codefmt.overrideAttrs (old: {
758 dependencies = with self; [ vim-maktaba ];
759 });
760
761 vim-dasht = super.vim-dasht.overrideAttrs (old: {
762 preFixup = ''
763 substituteInPlace $out/autoload/dasht.vim \
764 --replace "['dasht']" "['${dasht}/bin/dasht']"
765 '';
766 });
767
768 vim-easytags = super.vim-easytags.overrideAttrs (old: {
769 dependencies = with self; [ vim-misc ];
770 patches = [
771 (fetchpatch {
772 # https://github.com/xolox/vim-easytags/pull/170 fix version detection for universal-ctags
773 url = "https://github.com/xolox/vim-easytags/commit/46e4709500ba3b8e6cf3e90aeb95736b19e49be9.patch";
774 sha256 = "0x0xabb56xkgdqrg1mpvhbi3yw4d829n73lsnnyj5yrxjffy4ax4";
775 })
776 ];
777 });
778
779 vim-fzf-coauthorship = super.vim-fzf-coauthorship.overrideAttrs (old: {
780 dependencies = with self; [ fzf-vim ];
781 });
782
783 # change the go_bin_path to point to a path in the nix store. See the code in
784 # fatih/vim-go here
785 # https://github.com/fatih/vim-go/blob/155836d47052ea9c9bac81ba3e937f6f22c8e384/autoload/go/path.vim#L154-L159
786 vim-go = super.vim-go.overrideAttrs (old:
787 let
788 binPath = lib.makeBinPath [
789 asmfmt
790 delve
791 errcheck
792 go-motion
793 go-tools
794 gocode
795 gocode-gomod
796 godef
797 gogetdoc
798 golint
799 golangci-lint
800 gomodifytags
801 gopls
802 gotags
803 gotools
804 iferr
805 impl
806 reftools
807 ];
808 in
809 {
810 postPatch = ''
811 ${gnused}/bin/sed \
812 -Ee 's@"go_bin_path", ""@"go_bin_path", "${binPath}"@g' \
813 -i autoload/go/config.vim
814 '';
815 });
816
817 vim-gist = super.vim-gist.overrideAttrs (old: {
818 dependencies = with self; [ webapi-vim ];
819 });
820
821 vim-grammarous = super.vim-grammarous.overrideAttrs (old: {
822 # use `:GrammarousCheck` to initialize checking
823 # In neovim, you also want to use set
824 # let g:grammarous#show_first_error = 1
825 # see https://github.com/rhysd/vim-grammarous/issues/39
826 patches = [
827 (substituteAll {
828 src = ./patches/vim-grammarous/set_default_languagetool.patch;
829 inherit languagetool;
830 })
831 ];
832 });
833
834 vim-hexokinase = super.vim-hexokinase.overrideAttrs (old: {
835 preFixup =
836 let
837 hexokinase = buildGoModule {
838 name = "hexokinase";
839 src = old.src + "/hexokinase";
840 vendorSha256 = "pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
841 };
842 in
843 ''
844 ln -s ${hexokinase}/bin/hexokinase $target/hexokinase/hexokinase
845 '';
846
847 meta.platforms = lib.platforms.all;
848 });
849
850 vim-hier = super.vim-hier.overrideAttrs (old: {
851 buildInputs = [ vim ];
852 });
853
854 vim-isort = super.vim-isort.overrideAttrs (old: {
855 postPatch = ''
856 substituteInPlace ftplugin/python_vimisort.vim \
857 --replace 'import vim' 'import vim; import sys; sys.path.append("${python.pkgs.isort}/${python.sitePackages}")'
858 '';
859 });
860
861 vim-markdown-composer =
862 let
863 vim-markdown-composer-bin = rustPlatform.buildRustPackage rec {
864 pname = "vim-markdown-composer-bin";
865 inherit (super.vim-markdown-composer) src version;
866 cargoSha256 = "1cvnjsw5dd02wrm1q5xi8b033rsn44f7fkmw5j7lhskv5j286zrh";
867 };
868 in
869 super.vim-markdown-composer.overrideAttrs (oldAttrs: rec {
870 preFixup = ''
871 substituteInPlace "$out"/after/ftplugin/markdown/composer.vim \
872 --replace "let l:args = [s:plugin_root . '/target/release/markdown-composer']" \
873 "let l:args = ['${vim-markdown-composer-bin}/bin/markdown-composer']"
874 '';
875 });
876
877 vim-metamath = super.vim-metamath.overrideAttrs (old: {
878 preInstall = "cd vim";
879 });
880
881 vim-snipmate = super.vim-snipmate.overrideAttrs (old: {
882 dependencies = with self; [ vim-addon-mw-utils tlib_vim ];
883 });
884
885 vim-speeddating = super.vim-speeddating.overrideAttrs (old: {
886 dependencies = with self; [ vim-repeat ];
887 });
888
889 vim-stylish-haskell = super.vim-stylish-haskell.overrideAttrs (old: {
890 postPatch = old.postPatch or "" + ''
891 substituteInPlace ftplugin/haskell/stylish-haskell.vim --replace \
892 'g:stylish_haskell_command = "stylish-haskell"' \
893 'g:stylish_haskell_command = "${stylish-haskell}/bin/stylish-haskell"'
894 '';
895 });
896
897 vim-surround = super.vim-surround.overrideAttrs (old: {
898 dependencies = with self; [ vim-repeat ];
899 });
900
901 vim-textobj-entire = super.vim-textobj-entire.overrideAttrs (old: {
902 dependencies = with self; [ vim-textobj-user ];
903 meta.maintainers = with lib.maintainers; [ farlion ];
904 });
905
906 vim-unimpaired = super.vim-unimpaired.overrideAttrs (old: {
907 dependencies = with self; [ vim-repeat ];
908 });
909
910 vim-wakatime = super.vim-wakatime.overrideAttrs (old: {
911 buildInputs = [ python ];
912 });
913
914 vim-xdebug = super.vim-xdebug.overrideAttrs (old: {
915 postInstall = null;
916 });
917
918 vim-xkbswitch = super.vim-xkbswitch.overrideAttrs (old: {
919 patchPhase = ''
920 substituteInPlace plugin/xkbswitch.vim \
921 --replace /usr/local/lib/libxkbswitch.so ${xkb-switch}/lib/libxkbswitch.so
922 '';
923 buildInputs = [ xkb-switch ];
924 });
925
926 vim-yapf = super.vim-yapf.overrideAttrs (old: {
927 buildPhase = ''
928 substituteInPlace ftplugin/python_yapf.vim \
929 --replace '"yapf"' '"${python3.pkgs.yapf}/bin/yapf"'
930 '';
931 });
932
933 vim2nix = buildVimPluginFrom2Nix {
934 pname = "vim2nix";
935 version = "1.0";
936 src = ./vim2nix;
937 dependencies = with self; [ vim-addon-manager ];
938 };
939
940 vimacs = super.vimacs.overrideAttrs (old: {
941 buildPhase = ''
942 substituteInPlace bin/vim \
943 --replace '/usr/bin/vim' 'vim' \
944 --replace '/usr/bin/gvim' 'gvim'
945 # remove unnecessary duplicated bin wrapper script
946 rm -r plugin/vimacs
947 '';
948 meta = with lib; {
949 description = "Vim-Improved eMACS: Emacs emulation plugin for Vim";
950 homepage = "http://algorithm.com.au/code/vimacs";
951 license = licenses.gpl2Plus;
952 maintainers = with lib.maintainers; [ millerjason ];
953 };
954 });
955
956 vimsence = super.vimsence.overrideAttrs (old: {
957 meta = with lib; {
958 description = "Discord rich presence for Vim";
959 homepage = "https://github.com/hugolgst/vimsence";
960 maintainers = with lib.maintainers; [ hugolgst ];
961 };
962 });
963
964 vimproc-vim = super.vimproc-vim.overrideAttrs (old: {
965 buildInputs = [ which ];
966
967 buildPhase = ''
968 substituteInPlace autoload/vimproc.vim \
969 --replace vimproc_mac.so vimproc_unix.so \
970 --replace vimproc_linux64.so vimproc_unix.so \
971 --replace vimproc_linux32.so vimproc_unix.so
972 make -f make_unix.mak
973 '';
974 });
975
976 vimshell-vim = super.vimshell-vim.overrideAttrs (old: {
977 dependencies = with self; [ vimproc-vim ];
978 });
979
980 YankRing-vim = super.YankRing-vim.overrideAttrs (old: {
981 sourceRoot = ".";
982 });
983
984 YouCompleteMe = super.YouCompleteMe.overrideAttrs (old: {
985 buildPhase = ''
986 substituteInPlace plugin/youcompleteme.vim \
987 --replace "'ycm_path_to_python_interpreter', '''" \
988 "'ycm_path_to_python_interpreter', '${python3}/bin/python3'"
989
990 rm -r third_party/ycmd
991 ln -s ${ycmd}/lib/ycmd third_party
992 '';
993
994 meta = with lib; {
995 description = "A code-completion engine for Vim";
996 homepage = "https://github.com/Valloric/YouCompleteMe";
997 license = licenses.gpl3;
998 maintainers = with maintainers; [ marcweber jagajaga ];
999 platforms = platforms.unix;
1000 };
1001 });
1002
1003} // (
1004 let
1005 nodePackageNames = [
1006 "coc-clangd"
1007 "coc-cmake"
1008 "coc-css"
1009 "coc-diagnostic"
1010 "coc-emmet"
1011 "coc-eslint"
1012 "coc-explorer"
1013 "coc-git"
1014 "coc-go"
1015 "coc-highlight"
1016 "coc-html"
1017 "coc-imselect"
1018 "coc-java"
1019 "coc-jest"
1020 "coc-json"
1021 "coc-lists"
1022 "coc-markdownlint"
1023 "coc-metals"
1024 "coc-pairs"
1025 "coc-prettier"
1026 "coc-pyright"
1027 "coc-python"
1028 "coc-r-lsp"
1029 "coc-rls"
1030 "coc-rust-analyzer"
1031 "coc-smartf"
1032 "coc-snippets"
1033 "coc-solargraph"
1034 "coc-stylelint"
1035 "coc-tabnine"
1036 "coc-texlab"
1037 "coc-tslint"
1038 "coc-tslint-plugin"
1039 "coc-tsserver"
1040 "coc-ultisnips"
1041 "coc-vetur"
1042 "coc-vimlsp"
1043 "coc-vimtex"
1044 "coc-wxml"
1045 "coc-yaml"
1046 "coc-yank"
1047 ];
1048 nodePackage2VimPackage = name: buildVimPluginFrom2Nix {
1049 pname = name;
1050 inherit (nodePackages.${name}) version meta;
1051 src = "${nodePackages.${name}}/lib/node_modules/${name}";
1052 };
1053 in
1054 lib.genAttrs nodePackageNames nodePackage2VimPackage
1055)