diff options
author | Vincent Ambo <tazjin@tvl.su> | 2023-09-12T14·43+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-09-12T15·09+0000 |
commit | b4797251811cb7d8aa8a49447bb591f3aef2bfbe (patch) | |
tree | 5a1bb04c9ab59489c7477240c0ebb13e85cc9c06 /users/tazjin/emacs/default.nix | |
parent | 4d0ea1a317ba035f26458a1853c0949219a129f6 (diff) |
fix(tazjin/emacs): manually hook up tree-sitter grammars r/6586
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
Diffstat (limited to 'users/tazjin/emacs/default.nix')
-rw-r--r-- | users/tazjin/emacs/default.nix | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/users/tazjin/emacs/default.nix b/users/tazjin/emacs/default.nix index 1ad77656ca3d..fbec3a9e4fb5 100644 --- a/users/tazjin/emacs/default.nix +++ b/users/tazjin/emacs/default.nix @@ -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 (_: { |