summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-07-31 14:04:36 -0500
committerTim Keller <tjk@tjkeller.xyz>2026-07-31 14:04:36 -0500
commit6436d6b8a07bb22c975cffce84a534f6a262bb71 (patch)
treec0905ee95da630261ce3f9cf5b29fc21e730f16e
parentc306889115304c5eac45a653b1e8054f2e354d09 (diff)
downloadnixos-6436d6b8a07bb22c975cffce84a534f6a262bb71.tar.xz
nixos-6436d6b8a07bb22c975cffce84a534f6a262bb71.zip
tabs to spaces in vimplugins overrides and fix jinja2 plugin + rainbow delims. add jinja2 plugin to nvim in timmy/home.nix
-rw-r--r--pkgs/vimPlugins/overrides.nix112
-rw-r--r--users/timmy/home.nix1
2 files changed, 70 insertions, 43 deletions
diff --git a/pkgs/vimPlugins/overrides.nix b/pkgs/vimPlugins/overrides.nix
index a56511b..81a6f2f 100644
--- a/pkgs/vimPlugins/overrides.nix
+++ b/pkgs/vimPlugins/overrides.nix
@@ -1,46 +1,72 @@
final: prev: {
- vimPlugins = prev.vimPlugins // {
- minitab-nvim = prev.vimUtils.buildVimPlugin rec {
- pname = "minitab.nvim";
- version = "2024-11-28";
- rev = "f6183e8cb6f408e54dd5d1d13c0075376655a3ec";
- src = prev.fetchzip {
- url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${rev}.tar.xz";
- sha256 = "sha256-INJC+6GNTF5MpvtOh6/eYD5CMiXxlP6aHT5TX2lJqiM=";
- };
- meta.homepage = "https://git.tjkeller.xyz/minitab.nvim";
- };
+ vimPlugins = prev.vimPlugins // {
+ minitab-nvim = prev.vimUtils.buildVimPlugin rec {
+ pname = "minitab.nvim";
+ version = "2024-11-28";
+ rev = "f6183e8cb6f408e54dd5d1d13c0075376655a3ec";
+ src = prev.fetchzip {
+ url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${rev}.tar.xz";
+ sha256 = "sha256-INJC+6GNTF5MpvtOh6/eYD5CMiXxlP6aHT5TX2lJqiM=";
+ };
+ meta.homepage = "https://git.tjkeller.xyz/minitab.nvim";
+ };
- # TODO
- #nvim-treesitter-parsers = prev.vimPlugins.nvim-treesitter-parsers // {
- # #jinja2 = prev.tree-sitter.buildGrammar rec {
- # # language = "jinja2";
- # # version = "2025-10-24";
- # # src = prev.fetchFromGitHub {
- # # owner = "geigerzaehler";
- # # repo = "tree-sitter-jinja2";
- # # rev = "ecab6215c53da5c1126d81d1bf664b3b5cf87d15";
- # # sha256 = "sha256-gYU9gQZMlLKYHVAISa5AF/KXzr0PA0M8gK0/B7gXcYs=";
- # # };
- # # meta.homepage = "https://github.com/geigerzaehler/tree-sitter-jinja2";
- # #};
- # #jinja2 = prev.vimUtils.buildVimPlugin rec {
- # # pname = "jinja2";
- # # version = "2025-10-24";
- # # src = prev.fetchFromGitHub {
- # # owner = "geigerzaehler";
- # # repo = "tree-sitter-jinja2";
- # # rev = "ecab6215c53da5c1126d81d1bf664b3b5cf87d15";
- # # sha256 = "sha256-gYU9gQZMlLKYHVAISa5AF/KXzr0PA0M8gK0/B7gXcYs=";
- # # };
- # # patches = [
- # # (prev.fetchpatch {
- # # url = "https://github.com/geigerzaehler/tree-sitter-jinja2/pull/6.diff";
- # # sha256 = "sha256-CBUAwb9hz1Cpa4RaY+6aTMJNU+hX9D3BGpNxL+MoAq0=";
- # # })
- # # ];
- # # meta.homepage = "https://github.com/geigerzaehler/tree-sitter-jinja2";
- # #};
- #};
- };
+ tree-sitter-jinja2 = prev.vimUtils.buildVimPlugin rec {
+ pname = "tree-sitter-jinja2";
+ version = "2026-07-17";
+ src = prev.fetchFromGitHub {
+ owner = "geigerzaehler";
+ repo = "tree-sitter-jinja2";
+ rev = "7af726f7ac42db3fe798d45ee375078bbef28a41";
+ sha256 = "sha256-6lw38wvrQP/c3z7m40ygXNij60Gh2owx+Ibvfzwa47s=";
+ };
+ nativeBuildInputs = [ prev.tree-sitter ];
+ buildPhase = ''
+ # Provide tree-sitter with a place it can write to
+ mkdir -p $TMPDIR/.cache/tree-sitter
+ export XDG_CACHE_HOME=$TMPDIR/.cache
+ # Copy build instructions from repo
+ tree-sitter build --output parser/jinja2.so
+ '';
+ meta.homepage = "https://github.com/geigerzaehler/tree-sitter-jinja2";
+ };
+
+ rainbow-delimiters-nvim = prev.vimPlugins.rainbow-delimiters-nvim.overrideAttrs (finalAttrs: previousAttrs: {
+ patches = [
+ # Add support for htmljinja
+ (prev.fetchpatch {
+ url = "https://github.com/HiPhish/rainbow-delimiters.nvim/pull/194.diff";
+ sha256 = "sha256-ulJJnBUACs1evBbKoAg7LVJ4p2rdz+nhRKAP757Ysrc=";
+ })
+ ];
+ });
+
+ # TODO replace plugin for simple grammar
+ #nvim-treesitter-parsers = prev.vimPlugins.nvim-treesitter-parsers // {
+ # jinja2 = prev.tree-sitter.buildGrammar rec {
+ # language = "jinja2";
+ # version = "2026-07-17";
+ # src = prev.fetchFromGitHub {
+ # owner = "geigerzaehler";
+ # repo = "tree-sitter-jinja2";
+ # rev = "7af726f7ac42db3fe798d45ee375078bbef28a41";
+ # sha256 = "sha256-6lw38wvrQP/c3z7m40ygXNij60Gh2owx+Ibvfzwa47s=";
+ # };
+ # nativeBuildInputs = [ prev.tree-sitter prev.jq ];
+ # buildPhase = ''
+ # mkdir -p $TMPDIR/.cache/tree-sitter
+ # export XDG_CACHE_HOME=$TMPDIR/.cache
+ # tree-sitter build --output parser/jinja2.so
+ # # FIXME the parser needs to be built with tree_sitter_htmljinja as the
+ # #grammar name instead of jinja2.
+ # # The plugin registers htmljinja to use the jinja2 parser within nvim.
+ # # But if you want this to be a "dumb" solution without any lua commands
+ # # to register the language then it needs to be built with the correct
+ # # symbol.
+ # #ln -s jinja2.so parsers/htmljinja.so
+ # '';
+ # meta.homepage = "https://github.com/geigerzaehler/tree-sitter-jinja2";
+ # };
+ #};
+ };
}
diff --git a/users/timmy/home.nix b/users/timmy/home.nix
index 4d61600..c253b3b 100644
--- a/users/timmy/home.nix
+++ b/users/timmy/home.nix
@@ -95,6 +95,7 @@ in {
nvim-ts-autotag # depends on treesitter
rainbow-delimiters-nvim # depends on treesitter
snacks-nvim
+ tree-sitter-jinja2
];
};
extraPackages = with pkgs; [