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

185 lines
3 KiB
Nix
Raw Permalink Normal View History

2023-04-14 17:45:14 +03:00
{ runCommand
, fetchFromGitea
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";
2023-06-21 12:25:48 +03:00
version = "2023-06-21";
2023-04-14 17:45:14 +03:00
src = fetchFromGitea {
domain = "git.pleshevski.ru";
2022-12-12 21:50:03 +03:00
owner = "pleshevskiy";
repo = "tree-sitter-d2";
2023-06-21 12:25:48 +03:00
rev = "8a9d50043d58eedf1e375b0e2059e43efd856902";
sha256 = "sha256-ZhVjxo7Xi7DaHN3qabUcykflY74bUqPcOA410fA3zRk=";
2022-12-12 21:50:03 +03:00
};
};
};
tree-sitter = (inputs.tree-sitter.override { inherit extraGrammars; });
2023-04-14 17:45:14 +03:00
customGrammars = tree-sitter.withPlugins (g: [ g.tree-sitter-d2 ]);
2022-12-12 21:50:03 +03:00
2023-04-14 17:45:14 +03:00
nvim-treesitter = (inputs.nvim-treesitter.withPlugins (g: [
# g.agda
# g.arduino
# g.astro
g.awk
g.bash
# g.beancount
# g.bibtex
# g.blueprint
# g.c
# g.c_sharp
# g.clojure
g.cmake
g.comment
g.commonlisp
# g.cooklang
# g.cpp
g.css
# g.cuda
# g.d
# g.d2
# g.dart
# g.devicetree
g.diff
g.dockerfile
# g.dot
# g.eex
# g.elixir
g.elm
# g.elvish
g.embedded_template
# g.erlang
# g.fennel
# g.fish
# g.foam
# g.fortran
# g.fusion
# g.gdscript
g.git_rebase
g.gitattributes
g.gitignore
# g.gleam
# g.glimmer
# g.glsl
# g.go
# g.godot_resource
# g.gomod
# g.gowork
g.graphql
# g.hack
g.haskell
# g.hcl
# g.heex
# g.hjson
# g.hlsl
# g.hocon
g.html
g.http
# g.java
g.javascript
g.jq
g.jsdoc
g.json
g.json5
g.jsonc
# g.jsonnet
# g.julia
# g.kotlin
# g.lalrpop
# g.latex
g.ledger
# g.llvm
g.lua
# g.m68k
g.make
g.markdown
g.markdown_inline
# g.menhir
# g.meson
2023-10-31 16:38:28 +03:00
g.nickel
2023-04-14 17:45:14 +03:00
# g.ninja
g.nix
# g.norg
# g.ocaml
# g.ocaml_interface
# g.ocamllex
g.org
# g.pascal
# g.perl
# g.php
# g.phpdoc
# g.pioasm
# g.prisma
# g.proto
g.pug
g.python
# g.ql
# g.qmljs
g.query
# g.r
# g.racket
# g.rasi
g.regex
# g.rego
# g.rnoweb
# g.rst
# g.ruby
g.rust
# g.scala
g.scheme
g.scss
# g.slint
# g.solidity
# g.sparql
g.sql
# g.supercollider
# g.surface
# g.svelte
# g.swift
# g.sxhkdrc
# g.teal
# g.tiger
# g.tlaplus
g.todotxt
2023-06-16 07:51:28 +03:00
g.toml
2023-12-08 13:06:16 +03:00
g.tsx
2023-04-14 17:45:14 +03:00
# g.turtle
# g.twig
g.typescript
# g.v
# g.vala
# g.verilog
# g.vhs
g.vim
g.vue
# g.wgsl
g.yaml
# g.yang
# g.zig
])).overrideAttrs (oldAttrs: {
2022-12-13 10:09:12 +03:00
passthru.dependencies = oldAttrs.passthru.dependencies ++ [
(runCommand "nvim-treesitter-d2-grammar" { } ''
mkdir -p $out/parser
2023-04-14 17:45:14 +03:00
ln -s ${customGrammars}/d2.so $out/parser/d2.so
'')
];
2022-12-12 21:50:03 +03:00
postPatch = ''
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
];
}