default.nix 874 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. { fetchFromGitHub, fetchpatch, buildNeovimPlugin }:
  2. let
  3. plugins = builtins.fromJSON (builtins.readFile ./sources.json);
  4. overrides = {
  5. "leafgarland/typescript-vim" = {
  6. patches = [
  7. # make compiler build entire project
  8. ./typescript-vim-compiler.patch
  9. ];
  10. };
  11. "nvim-telescope/telescope-fzf-native.nvim" = {
  12. dontBuild = false;
  13. };
  14. };
  15. buildPlugin = name: spec:
  16. let
  17. nameParts = builtins.split "/" name;
  18. owner = builtins.head nameParts;
  19. repo = builtins.elemAt nameParts 2;
  20. in
  21. buildNeovimPlugin ({
  22. name = repo;
  23. src = fetchFromGitHub {
  24. inherit owner repo;
  25. inherit (spec) rev sha256;
  26. };
  27. passthru = {
  28. optional = spec.optional or false;
  29. };
  30. dontBuild = true;
  31. } // (overrides.${name} or {}));
  32. in
  33. builtins.mapAttrs buildPlugin plugins