-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
46 lines (43 loc) · 1.53 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = import nixpkgs { inherit system; };
in
{
devShells.default = pkgs.mkShell {
packages = [ pkgs.sbt ];
};
packages.tree-sitter = pkgs.stdenv.mkDerivation {
name = "tree-sitter";
src = pkgs.fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter";
rev = "v0.24.3";
sha256 = "sha256-2Pg4D1Pf1Ex6ykXouAJvD1NVfg5CH4rCQcSTAJmYwd4=";
};
buildPhase = "make";
installPhase = if system == "x86_64-darwin" || system == "aarch64-darwin" then ''
cp libtree-sitter.dylib $out
'' else ''
cp libtree-sitter.so $out
'';
};
packages.tree-sitter-python = pkgs.stdenv.mkDerivation {
name = "tree-sitter-python";
src = pkgs.fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter-python";
rev = "v0.23.2";
sha256 = "sha256-cOBG2xfFJ0PpR1RIKW1GeeNeOBA9DAP/N4RXRGYp3yw=";
};
buildPhase = "make";
installPhase = if system == "x86_64-darwin" || system == "aarch64-darwin" then ''
cp libtree-sitter-python.dylib $out
'' else ''
cp libtree-sitter-python.so $out
'';
};
});
}