default.nix 961 B

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. ];
  13. };
  14. "nvim-telescope/telescope-fzf-native.nvim" = {
  15. dontBuild = false;
  16. };
  17. };
  18. buildPlugin = name: spec:
  19. let
  20. nameParts = builtins.split "/" name;
  21. owner = builtins.head nameParts;
  22. repo = builtins.elemAt nameParts 2;
  23. in
  24. buildNeovimPlugin ({
  25. name = repo;
  26. src = fetchFromGitHub {
  27. inherit owner repo;
  28. inherit (spec) rev sha256;
  29. };
  30. passthru = {
  31. optional = spec.optional or false;
  32. };
  33. dontBuild = true;
  34. } // (overrides.${name} or {}));
  35. in
  36. builtins.mapAttrs buildPlugin plugins