This repository has been archived on 2024-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/plugins/syntax/default.nix

43 lines
912 B
Nix
Raw Normal View History

2022-10-22 23:35:27 +03:00
{ lib
2022-12-12 21:50:03 +03:00
, fetchFromGitHub
2022-10-22 23:35:27 +03:00
, ...
2022-12-12 21:50:03 +03:00
} @ inputs:
2022-09-15 09:57:11 +03:00
2022-09-24 17:21:16 +03:00
let
2022-10-22 23:35:27 +03:00
inherit (builtins) readFile;
2022-12-12 21:50:03 +03:00
extraGrammars = {
tree-sitter-d2 = {
language = "d2";
src = fetchFromGitHub {
owner = "pleshevskiy";
repo = "tree-sitter-d2";
rev = "a1a2091ebf4521d965e13c918a601b5acb4d1a72";
sha256 = "sha256-1ZcWhbtmdPDkBoFfswfhlwbFLb2Uwq7lbSTs5wqiFzY=";
};
version = "0.0.0";
};
};
tree-sitter = (inputs.tree-sitter.override { inherit extraGrammars; });
grammars = tree-sitter.withPlugins (g: [ g.tree-sitter-d2 ]);
2022-12-12 21:50:03 +03:00
nvim-treesitter = inputs.nvim-treesitter.withAllGrammars.overrideAttrs (oldAttrs: {
2022-12-12 21:50:03 +03:00
postPatch = ''
rm -r parser
mkdir parser
ln -s ${grammars}/d2.so parser/d2.so
2022-12-12 21:50:03 +03:00
ln -s ${extraGrammars.tree-sitter-d2.src}/queries queries/d2
2022-12-12 21:50:03 +03:00
'';
});
2022-09-24 17:21:16 +03:00
in
2022-09-15 09:57:11 +03:00
{
2022-10-22 23:35:27 +03:00
luaConfig = readFile ./treesitter.lua;
2022-09-15 09:57:11 +03:00
plugins = [
2022-12-12 21:50:03 +03:00
nvim-treesitter
2022-09-15 09:57:11 +03:00
];
}