about summary refs log tree commit diff
path: root/users/Profpatsch/emacs-tree-sitter-move/shell.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/Profpatsch/emacs-tree-sitter-move/shell.nix')
-rw-r--r--users/Profpatsch/emacs-tree-sitter-move/shell.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/users/Profpatsch/emacs-tree-sitter-move/shell.nix b/users/Profpatsch/emacs-tree-sitter-move/shell.nix
new file mode 100644
index 000000000000..81d622ac73e5
--- /dev/null
+++ b/users/Profpatsch/emacs-tree-sitter-move/shell.nix
@@ -0,0 +1,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;
+}