Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Nix flake to easily compile custom tree-sitter grammars

Notifications You must be signed in to change notification settings

pta2002/build-ts-grammar.nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages