pta2002 / build-ts-grammar.nix

Nix flake to easily compile custom tree-sitter grammars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build tree-sitter grammars with Nix

!! DON'T USE THIS !!

It does not work anymore! Instead, the functionality here has now been upstreamed. Just use pkgs.tree-sitter.buildGrammar.

This is just a simple flake to help you build custom tree-sitter grammars on Nix, for usage with, for example, neovim.

Example usage:

{
  description = "Flake utils demo";

  inputs.flake-utils.url = "github:numtide/flake-utils";
  inputs.ts-build.url = "github:pta2002/build-ts-grammar.nix";
  inputs.gleam.url = "github:gleam-lang/tree-sitter-gleam";
  inputs.gleam.flake = false;

  outputs = { self, nixpkgs, flake-utils, ts-build, gleam }: flake-utils.lib.eachDefaultSystem (system:
    let pkgs = nixpkgs.legacyPackages.${system};
    in
    {
      packages.default = ts-build.lib.buildGrammar pkgs {
        language = "gleam";
        version = "0.25.0";
        source = gleam;
      };
    });
}

About

Nix flake to easily compile custom tree-sitter grammars


Languages

Language:Nix 100.0%