diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-01-18 18:50:19 +0100 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-01-18 18:54:14 +0100 |
| commit | 2215dbfa350fad76765c348d4710aab05de719c2 (patch) | |
| tree | cf6c22bf0ea6226510174233de5bf718a8441037 /pkgs/by-name/tr/tree-sitter-yts/package.nix | |
| parent | modules/adb: Remove deprecated `programs.adb` (diff) | |
| download | nixos-config-2215dbfa350fad76765c348d4710aab05de719c2.zip | |
modules/nvim: Update to the newest tree-sitter version
This includes quite a big collection of breaking changes, and as I can't have the same plugin twice in the `buildEnv` scope, some plugins (e.g. neorg and femacro) needed to be deactivated.
Diffstat (limited to 'pkgs/by-name/tr/tree-sitter-yts/package.nix')
| -rw-r--r-- | pkgs/by-name/tr/tree-sitter-yts/package.nix | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/pkgs/by-name/tr/tree-sitter-yts/package.nix b/pkgs/by-name/tr/tree-sitter-yts/package.nix index 62ecf063..eef65714 100644 --- a/pkgs/by-name/tr/tree-sitter-yts/package.nix +++ b/pkgs/by-name/tr/tree-sitter-yts/package.nix @@ -14,46 +14,10 @@ nodejs, tree-sitter, }: -stdenv.mkDerivation { - pname = "yts-grammar"; - version = "1.0.0"; +tree-sitter.buildGrammar { + language = "yts"; + version = "0.0.1+rev=0bb9a60"; inherit (yt) src; sourceRoot = "yt/tree-sitter-yts"; - - nativeBuildInputs = [nodejs tree-sitter]; - - CFLAGS = ["-Isrc" "-O2"]; - CXXFLAGS = ["-Isrc" "-O2"]; - - stripDebugList = ["parser"]; - - configurePhase = '' - tree-sitter generate - ''; - - # When both scanner.{c,cc} exist, we should not link both since they may be the same but in - # different languages. Just randomly prefer C++ if that happens. - buildPhase = '' - runHook preBuild - if [[ -e src/scanner.cc ]]; then - $CXX -fPIC -c src/scanner.cc -o scanner.o $CXXFLAGS - elif [[ -e src/scanner.c ]]; then - $CC -fPIC -c src/scanner.c -o scanner.o $CFLAGS - fi - $CC -fPIC -c src/parser.c -o parser.o $CFLAGS - rm -rf parser - $CXX -shared -o parser *.o - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - mkdir $out - mv parser $out/ - if [[ -d queries ]]; then - cp -r queries $out - fi - runHook postInstall - ''; } |
