-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
33 lines (33 loc) · 1 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }@inputs:
let
defaultPackage = pkgs:
pkgs.callPackage
(nixpkgs + "/pkgs/development/tools/parsing/tree-sitter/grammar.nix")
{ } {
language = "syslang";
source = ./.;
inherit (pkgs.tree-sitter) version;
};
in (flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
defaultPackage = defaultPackage pkgs;
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nodejs_latest
nodePackages.node-gyp-build
nodePackages.node-gyp
tree-sitter
];
profile = ''
export npm_config_build_from_source=true
'';
};
})) // (let pkgs = import nixpkgs { };
in { defaultPackage = defaultPackage pkgs; });
}