default.nix 1020 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. "jose-elias-alvarez/typescript.nvim" = {
  9. patches = [ ./typescript-nvim-tsserver.patch ];
  10. };
  11. "nvim-treesitter/nvim-treesitter" = {
  12. # these extra rules causes nvim to crash when looking at a deeply nested
  13. # JSX expression
  14. patches = [ ./treesitter-jsx.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