fix(tazjin/emacs): manually hook up tree-sitter grammars

The mechanism in nixpkgs does not work, but doing it myself is not
that difficult.

Change-Id: I91b12e9c1f5d381c9990fd46e02169f5275f88da
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9309
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2023-09-12 17:43:20 +03:00 committed by clbot
parent 4d0ea1a317
commit b479725181

View file

@ -19,6 +19,23 @@ pkgs.makeOverridable
identity = x: x;
# tree-sitter grammars for various ts-modes
customTreesitGrammars = emacs.pkgs.treesit-grammars.with-grammars (g: with g; [
tree-sitter-bash
tree-sitter-c
tree-sitter-cmake
tree-sitter-cpp
tree-sitter-go
tree-sitter-java
tree-sitter-json
tree-sitter-latex
tree-sitter-nix
tree-sitter-python
tree-sitter-rust
tree-sitter-toml
tree-sitter-yaml
]);
tazjinsEmacs = pkgfun: (emacsWithPackages (epkgs: pkgfun (with epkgs; [
ace-link
ace-window
@ -89,25 +106,9 @@ pkgs.makeOverridable
zetteldeft
zoxide
# tree-sitter grammars for various ts-modes
(treesit-grammars.with-grammars (g: with g; [
tree-sitter-bash
tree-sitter-c
tree-sitter-cmake
tree-sitter-cpp
tree-sitter-go
tree-sitter-java
tree-sitter-json
tree-sitter-latex
tree-sitter-nix
tree-sitter-python
tree-sitter-rust
tree-sitter-toml
tree-sitter-yaml
]))
# Wonky stuff
(currentTelega epkgs)
customTreesitGrammars # TODO(tazjin): how is this *supposed* to work?!
# Custom depot packages (either ours, or overridden ones)
tvlPackages.dottime
@ -153,6 +154,7 @@ pkgs.makeOverridable
--no-site-lisp \
--no-init-file \
--directory ${./config} ${if l != null then "--directory ${l}" else ""} \
--eval "(add-to-list 'treesit-extra-load-path \"${customTreesitGrammars}/lib\")" \
--eval "(require 'init)" $@
'').overrideAttrs
(_: {