about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/nv/nvim/plgs/femaco/default.nix3
-rw-r--r--modules/by-name/nv/nvim/plgs/neorg/default.nix4
-rw-r--r--modules/by-name/nv/nvim/plgs/treesitter/default.nix44
-rw-r--r--modules/by-name/nv/nvim/plgs/vim-tex/default.nix5
-rw-r--r--pkgs/by-name/tr/tree-sitter-yts/package.nix42
5 files changed, 22 insertions, 76 deletions
diff --git a/modules/by-name/nv/nvim/plgs/femaco/default.nix b/modules/by-name/nv/nvim/plgs/femaco/default.nix
index 0388844a..eac6b393 100644
--- a/modules/by-name/nv/nvim/plgs/femaco/default.nix
+++ b/modules/by-name/nv/nvim/plgs/femaco/default.nix
@@ -14,7 +14,8 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+  # TODO: Re-active this plugin, when it does no longer depend on `treesitter-legacy` <2026-01-18>
+  home-manager.users.soispha.programs.nixvim = lib.mkIf false {
     plugins.femaco = {
       enable = true;
     };
diff --git a/modules/by-name/nv/nvim/plgs/neorg/default.nix b/modules/by-name/nv/nvim/plgs/neorg/default.nix
index ea451d3a..5ed87f0e 100644
--- a/modules/by-name/nv/nvim/plgs/neorg/default.nix
+++ b/modules/by-name/nv/nvim/plgs/neorg/default.nix
@@ -14,7 +14,9 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+  # TODO: Re-active, whence neorg actually builds with all the treesitter grammars
+  # activated <2026-01-18>
+  home-manager.users.soispha.programs.nixvim = lib.mkIf false {
     extraFiles = {
       "ftplugin/norg.lua".text = ''
         ${lib.strings.fileContents ./key_mappings.lua}
diff --git a/modules/by-name/nv/nvim/plgs/treesitter/default.nix b/modules/by-name/nv/nvim/plgs/treesitter/default.nix
index ed1499f8..ae4cc173 100644
--- a/modules/by-name/nv/nvim/plgs/treesitter/default.nix
+++ b/modules/by-name/nv/nvim/plgs/treesitter/default.nix
@@ -26,45 +26,23 @@ in {
     plugins.treesitter = {
       enable = true;
 
+      highlight.enable = true;
+      indent.enable = true;
+      folding.enable = true;
+
       # inject nixvim specific highlighting (eg in extraConfigLua).
       nixvimInjections = true;
 
-      nixGrammars = true;
-      grammarPackages =
-        # Append the `tree-sitter-yts` grammar to all the other grammars.
-        # TODO: Find a better way to do this. <2024-11-08>
-        config.home-manager.users.soispha.programs.nixvim.plugins.treesitter.package.passthru.allGrammars
-        ++ [pkgs.tree-sitter-yts];
-
-      settings = {
-        auto_install = false;
-        ensureInstalled = "all";
-        indent.enable = true;
-        disabledLanguages = [];
+      grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars ++ [pkgs.tree-sitter-yts];
 
-        highlight = {
-          enable = true;
-          disable = [];
+      # Register the parser to filetype
+      languageRegister.yts = "yts";
+    };
 
-          #  Setting this to true will run `:h syntax` and tree-sitter at the same time.
-          #  Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-          #  Using this option may slow down your editor; and you may see some duplicate highlights.
-          #  Instead of true it can also be a list of languages
-          additionalVimRegexHighlighting = [];
-        };
+    # TODO: Is that necessary? <2026-01-18>
+    # extraPlugins = [pkgs.tree-sitter-yts];
 
-        incrementalSelection = {
-          enable = true;
-          keymaps = {
-            # TODO: include these in the which-key description
-            initSelection = "gnn"; #  set to `false` to disable one of the mappings
-            nodeIncremental = "grn";
-            scopeIncremental = "grc";
-            nodeDecremental = "grm";
-          };
-        };
-      };
-    };
+    # TODO: Remove this by moving the queries in the package to `queries/<lang>/...`' <2026-01-18>
     extraFiles = {
       "queries/yts/highlights.scm".text = ''
         ${lib.strings.fileContents "${pkgs.tree-sitter-yts}/queries/highlights.scm"}
diff --git a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix
index 9ee657c3..71422f94 100644
--- a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix
+++ b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix
@@ -14,11 +14,12 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+  # TODO: Do I still need this module at all? <2026-01-18>
+  home-manager.users.soispha.programs.nixvim = lib.mkIf false {
     opts.conceallevel = 0;
 
     plugins.vimtex = {
-      enable = false;
+      enable = true;
       settings = {
         view_method = "zathura";
         quickfix_mode = -1;
diff --git a/pkgs/by-name/tr/tree-sitter-yts/package.nix b/pkgs/by-name/tr/tree-sitter-yts/package.nix
index 62ecf063..eef65714 100644
--- a/pkgs/by-name/tr/tree-sitter-yts/package.nix
+++ b/pkgs/by-name/tr/tree-sitter-yts/package.nix
@@ -14,46 +14,10 @@
   nodejs,
   tree-sitter,
 }:
-stdenv.mkDerivation {
-  pname = "yts-grammar";
-  version = "1.0.0";
+tree-sitter.buildGrammar {
+  language = "yts";
+  version = "0.0.1+rev=0bb9a60";
 
   inherit (yt) src;
   sourceRoot = "yt/tree-sitter-yts";
-
-  nativeBuildInputs = [nodejs tree-sitter];
-
-  CFLAGS = ["-Isrc" "-O2"];
-  CXXFLAGS = ["-Isrc" "-O2"];
-
-  stripDebugList = ["parser"];
-
-  configurePhase = ''
-    tree-sitter generate
-  '';
-
-  # When both scanner.{c,cc} exist, we should not link both since they may be the same but in
-  # different languages. Just randomly prefer C++ if that happens.
-  buildPhase = ''
-    runHook preBuild
-    if [[ -e src/scanner.cc ]]; then
-      $CXX -fPIC -c src/scanner.cc -o scanner.o $CXXFLAGS
-    elif [[ -e src/scanner.c ]]; then
-      $CC -fPIC -c src/scanner.c -o scanner.o $CFLAGS
-    fi
-    $CC -fPIC -c src/parser.c -o parser.o $CFLAGS
-    rm -rf parser
-    $CXX -shared -o parser *.o
-    runHook postBuild
-  '';
-
-  installPhase = ''
-    runHook preInstall
-    mkdir $out
-    mv parser $out/
-    if [[ -d queries ]]; then
-      cp -r queries $out
-    fi
-    runHook postInstall
-  '';
 }