default.nix 717 B

1234567891011121314151617181920212223242526272829303132
  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. };
  9. buildPlugin = name: spec:
  10. let
  11. nameParts = builtins.split "/" name;
  12. owner = builtins.head nameParts;
  13. repo = builtins.elemAt nameParts 2;
  14. in
  15. buildNeovimPlugin ({
  16. name = repo;
  17. src = fetchFromGitHub {
  18. inherit owner repo;
  19. inherit (spec) rev sha256;
  20. };
  21. passthru = {
  22. optional = spec.optional or false;
  23. };
  24. dontBuild = true;
  25. } // (overrides.${name} or {}));
  26. in
  27. builtins.mapAttrs buildPlugin plugins