about summary refs log tree commit diff
path: root/users/Profpatsch/emacs-tree-sitter-move/shell.nix
blob: 81d622ac73e5bf9f85cccb64bef185cfd6dd52eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{ 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;
}