Unfortunately, when I try to rebuild, I get the following error
error: collision between `/nix/store/gk8fghjz1dyc6vh00kxca87wg370dsi4-tree-sitter-latex-grammar-0.20.9/parser' and `/nix/store/kcr5qfzrk1vlmhd8qj8l3k9nfj8m5n2q-tree-sitter-bash-grammar-0.20.9/parser'
I’m not sure how to install these grammars. Since I use Emacs, I cannot use the available prepackaged neovim dedicated plugins.
this is almost certainly not the correct way to install the grammars, all grammars have the same filename and will collide with eachother as you noticed. There must be some emacs infrastructure to do so, like for neovim.
Indeed, but I couldn’t find it. I’ve searched for “tree sitter” in the Emacs overlay and in nixpkgs’ definition of Emacs, but besides a compile flag that controls native support for tree sitter (which is on in my config), there doesn’t seem to be anything related to tree sitter. Querying Emacs to know whether a grammar is available (eg. Rust’s grammar) yields that the grammar is not availble:
I had already installed these packages, but it doesn’t seem to work. For instance, launching the TOML mode with tree sitter support yields
⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for toml is unavailable (not-found):
/nix/store/wd9jym9m1gvsccq71zipmr0imr0pncvh-emacs-packages-deps/lib/libtree-sitter-toml: cannot open shared object file: No such file or directory
/nix/store/wd9jym9m1gvsccq71zipmr0imr0pncvh-emacs-packages-deps/lib/libtree-sitter-toml.0: cannot open shared object file: No such file or directory
/nix/store/wd9jym9m1gvsccq71zipmr0imr0pncvh-emacs-packages-deps/lib/libtree-sitter-toml.0.0: cannot open shared object file: No such file or directory
/nix/store/wd9jym9m1gvsccq71zipmr0imr0pncvh-emacs-packages-deps/lib/libtree-sitter-toml.so: cannot open shared object file: No such file or directory
/nix/store/wd9jym9m1gvsccq71zipmr0imr0pncvh-emacs-packages-deps/lib/libtree-sitter-toml.so.0: cannot open shared object file: No such file or directory
/nix/store/wd9jym9m1gvsccq71zipmr0imr0pncvh-emacs-packages-deps/lib/libtree-sitter-toml.so.0.0: cannot open shared object file: No such file or directory
/home/<redacted>/.emacs.d/tree-sitter/libtree-sitter-toml: cannot open shared object file: No such file or directory
/home/<redacted>/.emacs.d/tree-sitter/libtree-sitter-toml.0: cannot open shared object file: No such file or directory
/home/<redacted>/.emacs.d/tree-sitter/libtree-sitter-toml.0.0: cannot open shared object file: No such file or directory
/home/<redacted>/.emacs.d/tree-sitter/libtree-sitter-toml.so: cannot open shared object file: No such file or directory
/home/<redacted>/.emacs.d/tree-sitter/libtree-sitter-toml.so.0: cannot open shared object file: No such file or directory
/home/<redacted>/.emacs.d/tree-sitter/libtree-sitter-toml.so.0.0: cannot open shared object file: No such file or directory
libtree-sitter-toml: cannot open shared object file: No such file or directory
libtree-sitter-toml.0: cannot open shared object file: No such file or directory
libtree-sitter-toml.0.0: cannot open shared object file: No such file or directory
libtree-sitter-toml.so: cannot open shared object file: No such file or directory
libtree-sitter-toml.so.0: cannot open shared object file: No such file or directory
libtree-sitter-toml.so.0.0: cannot open shared object file: No such file or directory
which clearly shows that the grammar was not installed.