about summary refs log tree commit diff
path: root/users/Profpatsch/emacs-tree-sitter-move/shell.nix
blob: f400d5c021615dcd5628abae355a7e768bf7e064 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{ pkgs ? import ../../../third_party { }, ... }:
let
  inherit (pkgs) lib;

  treeSitterGrammars = pkgs.runCommandLocal "grammars" { } ''
    mkdir -p $out/bin
    ${lib.concatStringsSep "\n"
      (lib.mapAttrsToList (name: src: "ln -s ${src}/parser $out/bin/${name}.so") pkgs.tree-sitter.builtGrammars)};
  '';

in
pkgs.mkShell {
  buildInputs = [
    pkgs.tree-sitter.builtGrammars.python
  ];
  TREE_SITTER_GRAMMAR_DIR = treeSitterGrammars;
}