1
0

default.nix 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. };
  21. buildPlugin = name: spec:
  22. let
  23. nameParts = builtins.split "/" name;
  24. owner = builtins.head nameParts;
  25. repo = builtins.elemAt nameParts 2;
  26. in
  27. buildNeovimPlugin ({
  28. name = repo;
  29. src = fetchFromGitHub {
  30. inherit owner repo;
  31. inherit (spec) rev sha256;
  32. };
  33. passthru = {
  34. optional = spec.optional or false;
  35. };
  36. dontBuild = true;
  37. } // (overrides.${name} or {}));
  38. in
  39. builtins.mapAttrs buildPlugin plugins