treesitter: attempt to adapt to (breaking) Nixpkgs changes (#1315)
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions

* feat: update from builtGrammars to grammarPlugins

* fix: renamed packages

* chore: revert back the configs part

* wip: try using config

* chore: update flake

* docs: update release-note

---------

Co-authored-by: raf <raf@notashelf.dev>
This commit is contained in:
Thales Menato 2026-01-05 11:07:31 -05:00 committed by GitHub
commit e0f6fe7a2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 26 additions and 15 deletions

View file

@ -1,5 +1,11 @@
# Release 0.9 {#sec-release-0-9} # Release 0.9 {#sec-release-0-9}
## Breaking changes
- Nixpkgs merged a full and incompatible rewrite of vimPlugins.nvim-treesitter.
The changes affected how grammars are built and it caused issues when neovim
attempted to load languages and could not find files in expected locations.
## Changelog {#sec-release-0-9-changelog} ## Changelog {#sec-release-0-9-changelog}
[suimong](https://github.com/suimong): [suimong](https://github.com/suimong):
@ -7,6 +13,11 @@
- Fix `vim.tabline.nvimBufferline` where `setupOpts.options.hover` requires - Fix `vim.tabline.nvimBufferline` where `setupOpts.options.hover` requires
`vim.opt.mousemoveevent` to be set. `vim.opt.mousemoveevent` to be set.
[thamenato](https://github.com/thamenato):
- Attempt to adapt nvim-treesitter to (breaking) Nixpkgs changes. Some treesitte grammars
were changed to prefer `grammarPlugins` over `builtGrammars`.
[jfeo](https://github.com/jfeo): [jfeo](https://github.com/jfeo):
[ccc.nvim]: https://github.com/uga-rosa/ccc.nvim [ccc.nvim]: https://github.com/uga-rosa/ccc.nvim

6
flake.lock generated
View file

@ -73,11 +73,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1764081664, "lastModified": 1767364772,
"narHash": "sha256-sUoHmPr/EwXzRMpv1u/kH+dXuvJEyyF2Q7muE+t0EU4=", "narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dc205f7b4fdb04c8b7877b43edb7b73be7730081", "rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -30,7 +30,7 @@
mkGrammarOption = pkgs: grammar: mkGrammarOption = pkgs: grammar:
mkPackageOption pkgs ["${grammar} treesitter"] { mkPackageOption pkgs ["${grammar} treesitter"] {
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar]; default = ["vimPlugins" "nvim-treesitter" "grammarPlugins" grammar];
}; };
in { in {
inherit diagnostics diagnosticSubmodule mkGrammarOption; inherit diagnostics diagnosticSubmodule mkGrammarOption;

View file

@ -178,7 +178,7 @@ in {
treesitter = { treesitter = {
enable = mkEnableOption "C# treesitter" // {default = config.vim.languages.enableTreesitter;}; enable = mkEnableOption "C# treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "c-sharp"; package = mkGrammarOption pkgs "c_sharp";
}; };
lsp = { lsp = {

View file

@ -63,7 +63,7 @@ in {
description = "Enable Markdown treesitter"; description = "Enable Markdown treesitter";
}; };
mdPackage = mkGrammarOption pkgs "markdown"; mdPackage = mkGrammarOption pkgs "markdown";
mdInlinePackage = mkGrammarOption pkgs "markdown-inline"; mdInlinePackage = mkGrammarOption pkgs "markdown_inline";
}; };
lsp = { lsp = {

View file

@ -228,7 +228,7 @@ in {
package = mkOption { package = mkOption {
description = "Python treesitter grammar to use"; description = "Python treesitter grammar to use";
type = package; type = package;
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.python; default = pkgs.vimPlugins.nvim-treesitter.grammarPlugins.python;
}; };
}; };

View file

@ -66,7 +66,7 @@ in {
package = mkOption { package = mkOption {
type = package; type = package;
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.sql; default = pkgs.vimPlugins.nvim-treesitter.grammarPlugins.sql;
description = "SQL treesitter grammar to use"; description = "SQL treesitter grammar to use";
}; };
}; };

View file

@ -21,7 +21,7 @@ in {
pluginRC.orgmode = entryAnywhere '' pluginRC.orgmode = entryAnywhere ''
-- Treesitter configuration -- Treesitter configuration
require('nvim-treesitter.configs').setup { require('nvim-treesitter.config').setup {
-- If TS highlights are not enabled at all, or disabled via `disable` prop, -- If TS highlights are not enabled at all, or disabled via `disable` prop,
-- highlighting will fallback to default Vim syntax highlighting -- highlighting will fallback to default Vim syntax highlighting

View file

@ -52,7 +52,7 @@ in {
''); '');
pluginRC.treesitter = entryAfter ["basic"] '' pluginRC.treesitter = entryAfter ["basic"] ''
require('nvim-treesitter.configs').setup { require('nvim-treesitter.config').setup {
-- Disable imperative treesitter options that would attempt to fetch -- Disable imperative treesitter options that would attempt to fetch
-- grammars into the read-only Nix store. To add additional grammars here -- grammars into the read-only Nix store. To add additional grammars here
-- you must use the `config.vim.treesitter.grammars` option. -- you must use the `config.vim.treesitter.grammars` option.

View file

@ -25,14 +25,14 @@ in {
type = listOf package; type = listOf package;
default = []; default = [];
example = literalExpression '' example = literalExpression ''
with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [
regex regex
kdl kdl
]; ];
''; '';
description = '' description = ''
List of treesitter grammars to install. For grammars to be installed properly, List of treesitter grammars to install. For grammars to be installed properly,
you must use grammars from `pkgs.vimPlugins.nvim-treesitter.builtGrammars`. you must use grammars from `pkgs.vimPlugins.nvim-treesitter.grammarPlugins`.
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars. You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars.
For languages already supported by nvf, you may use For languages already supported by nvf, you may use
@ -56,7 +56,7 @@ in {
internal = true; internal = true;
readOnly = true; readOnly = true;
type = listOf package; type = listOf package;
default = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [c lua vim vimdoc query]; default = with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [c lua vim vimdoc query];
description = '' description = ''
A list of treesitter grammars that will be installed by default A list of treesitter grammars that will be installed by default
if treesitter has been enabled and {option}`vim.treeesitter.addDefaultGrammars` if treesitter has been enabled and {option}`vim.treeesitter.addDefaultGrammars`

View file

@ -16,7 +16,7 @@ in {
# set up treesitter-textobjects after Treesitter, whose config we're adding to. # set up treesitter-textobjects after Treesitter, whose config we're adding to.
pluginRC.treesitter-textobjects = entryAfter ["treesitter"] '' pluginRC.treesitter-textobjects = entryAfter ["treesitter"] ''
require("nvim-treesitter.configs").setup({textobjects = ${toLuaObject cfg.setupOpts}}) require("nvim-treesitter.config").setup({textobjects = ${toLuaObject cfg.setupOpts}})
''; '';
}; };
}; };

View file

@ -12,7 +12,7 @@
cfg = config.vim.ui.noice; cfg = config.vim.ui.noice;
tscfg = config.vim.treesitter; tscfg = config.vim.treesitter;
defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [vim regex lua bash markdown]; defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [vim regex lua bash markdown];
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {