1
0

default.nix 1003 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. # these extra rules causes nvim to crash when looking at a deeply nested
  10. # JSX expression
  11. patches = [ ./treesitter-jsx.patch ];
  12. };
  13. "mistweaverco/kulala.nvim" = {
  14. patches = [ ./kulala-treesitter.patch ];
  15. };
  16. };
  17. buildPlugin = name: spec:
  18. let
  19. nameParts = builtins.split "/" name;
  20. owner = builtins.head nameParts;
  21. repo = builtins.elemAt nameParts 2;
  22. in
  23. buildNeovimPlugin ({
  24. name = repo;
  25. src = fetchFromGitHub {
  26. inherit owner repo;
  27. inherit (spec) rev sha256;
  28. };
  29. passthru = {
  30. optional = spec.optional or false;
  31. };
  32. dontBuild = true;
  33. } // (overrides.${name} or {}));
  34. in
  35. builtins.mapAttrs buildPlugin plugins