vimPlugins.nvim-treesitter: add workaround for #332580

A #319233 accidentally reverted #321550. Last one caused a very annoying
regression to any Nix user (see #332580). I suppose this is a bug in
upstream grammar, so I workaround it this way until it is properly
resolved.
This commit is contained in:
PerchunPak 2024-09-10 06:43:26 +02:00
parent 7fc75e0242
commit 98ca865c9d
No known key found for this signature in database
GPG Key ID: 313F67D1EAB770F9

View File

@ -4,9 +4,17 @@ self: super:
let
inherit (neovimUtils) grammarToPlugin;
generatedGrammars = callPackage ./generated.nix {
initialGeneratedGrammars = callPackage ./generated.nix {
inherit (tree-sitter) buildGrammar;
};
grammarOverrides = final: prev: {
nix = prev.nix.overrideAttrs {
# workaround for https://github.com/NixOS/nixpkgs/issues/332580
prePatch = "rm queries/highlights.scm";
};
};
generatedGrammars = lib.fix (lib.extends grammarOverrides (_: initialGeneratedGrammars));
generatedDerivations = lib.filterAttrs (_: lib.isDerivation) generatedGrammars;