default.nix 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. { fetchFromGitHub, fetchpatch, buildNeovimPlugin }:
  2. let
  3. plugins = builtins.fromJSON (builtins.readFile ./sources.json);
  4. overrides = {
  5. "tpope/vim-fugitive" = {
  6. patches = [ ./fugitive-origin-head.patch ];
  7. };
  8. "leafgarland/typescript-vim" = {
  9. patches = [
  10. # make compiler build entire project
  11. ./typescript-vim-compiler.patch
  12. # prevent unsetting omnifunc
  13. (fetchpatch {
  14. url = "https://github.com/leafgarland/typescript-vim/pull/202.patch";
  15. sha256 = "sha256-xHgOdoA8qBesCgNk9J8dINSgSyXj4ymmfcJEm+qWs54";
  16. })
  17. ];
  18. };
  19. "nvim-telescope/telescope-fzf-native.nvim" = {
  20. dontBuild = false;
  21. };
  22. };
  23. buildPlugin = name: spec:
  24. let
  25. nameParts = builtins.split "/" name;
  26. owner = builtins.head nameParts;
  27. repo = builtins.elemAt nameParts 2;
  28. in
  29. buildNeovimPlugin ({
  30. name = repo;
  31. src = fetchFromGitHub (spec // {
  32. inherit owner repo;
  33. });
  34. dontBuild = true;
  35. } // (overrides.${name} or {}));
  36. in
  37. builtins.mapAttrs buildPlugin plugins