default.nix 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. { fetchFromGitHub, fetchpatch, buildNeovimPlugin }:
  2. let
  3. plugins = builtins.fromJSON (builtins.readFile ./sources.json);
  4. overrides = {
  5. "nvim-telescope/telescope-fzf-native.nvim" = {
  6. dontBuild = false;
  7. };
  8. "nvim-treesitter/nvim-treesitter" = {
  9. patches = [
  10. # these extra rules causes nvim to crash when looking at a deeply nested
  11. # JSX expression
  12. ./treesitter-jsx.patch
  13. # try to fix indentation in JS
  14. ./treesitter-ecma.patch
  15. ];
  16. };
  17. "mistweaverco/kulala.nvim" = {
  18. patches = [ ./kulala-treesitter.patch ];
  19. };
  20. "FourierTransformer/tinytoml" = {
  21. postPatch = ''
  22. mkdir lua
  23. mv tinytoml.lua lua
  24. '';
  25. };
  26. };
  27. buildPlugin = name: spec:
  28. let
  29. nameParts = builtins.split "/" name;
  30. owner = builtins.head nameParts;
  31. repo = builtins.elemAt nameParts 2;
  32. in
  33. buildNeovimPlugin ({
  34. name = repo;
  35. src = fetchFromGitHub {
  36. inherit owner repo;
  37. inherit (spec) rev sha256;
  38. };
  39. passthru = {
  40. optional = spec.optional or false;
  41. };
  42. dontBuild = true;
  43. } // (overrides.${name} or {}));
  44. in
  45. builtins.mapAttrs buildPlugin plugins