I used to be able to override the nvim-treesitter
package from nixpkgs
(to a newer version) by doing the following:
nvim-treesitter = pkgs.vimPlugins.nvim-treesitter.overrideAttrs (_: {
version = "2023-03-27";
src = pkgs.fetchFromGitHub {
owner = "nvim-treesitter";
repo = "nvim-treesitter";
rev = "25dd24ed0e3b4456b1987cdd744e261be5dc6c7c";
sha256 = "1rzg2dwrh536p2h341zrnam46gdfc3kkq60lvzqj7k1s4xymm377";
fetchSubmodules = false;
};
});
In my home-manager
configuration I reference it by doing the following:
{
plugin = nvim-treesitter.withPlugins (
plugins: with plugins; [
tree-sitter-nix
]
);
config = builtins.readFile ../../config/nvim/plugins/treesitter.fnl;
type = "fennel";
}
(This is definitely referencing the variable I defined earlier. It is not accidentally referencing pkgs.vimPlugins
.)
I expected this to install my new derivation, but it always install the one from nixpkgs
(2023-03-22
at the time of writing).
I’m 99% certain that this used to work, but it must’ve stopped working at some point in the past. Sadly I can’t pin down when exactly, because I only realized it stopped working yesterday (because of deprecation warnings in neovim).
I don’t know enough about the nix language itself to pin down why, but it looks like withPlugins
returns the derivation from nixpkgs
? Could this be because of the self
in the withPlugins
implementation?
How can I reference a newer version of nvim-treesitter
and continue to use the niceties that the nixpkgs
derivation provides?