blob: ca8825789931a78c815be86dc531e69ae7e12398 (
plain) (
blame)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
{
description = "tree-sitter-yts";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
npmlock2nix = {
url = "github:nix-community/npmlock2nix";
flake = false;
};
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
npmlock2nix,
crane,
}: (flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
npmlock2nix' = pkgs.callPackage npmlock2nix {};
craneLib = crane.mkLib pkgs;
in {
build = self.packages.${system}.tree-sitter-nix;
rust-bindings = craneLib.buildPackage {
src = self;
};
# Requires xcode
node-bindings = npmlock2nix'.v2.build {
src = self;
inherit (self.devShells.${system}.default) nativeBuildInputs;
inherit (pkgs) nodejs;
buildCommands = [
"${pkgs.nodePackages.node-gyp}/bin/node-gyp configure"
"npm run build"
];
installPhase = ''
touch $out
'';
};
packages.tree-sitter-yts = (pkgs.callPackage ./grammar.nix {}) {
language = "yts";
version = "1.0";
src = self;
};
packages.default = self.packages.${system}.tree-sitter-yts;
devShells.default = pkgs.mkShell {
packages = [
pkgs.nodejs
pkgs.python3
pkgs.tree-sitter
pkgs.editorconfig-checker
pkgs.rustc
pkgs.cargo
# Formatters
pkgs.treefmt
pkgs.nixpkgs-fmt
pkgs.nodePackages.prettier
pkgs.rustfmt
pkgs.clang-tools
];
};
}));
}
|