-
Notifications
You must be signed in to change notification settings - Fork 7
/
flake.nix
31 lines (31 loc) · 976 Bytes
/
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
let
defaultPackage = pkgs: pkgs.callPackage (nixpkgs + "/pkgs/development/tools/parsing/tree-sitter/grammar.nix") { } {
language = "typst";
src = ./.;
inherit (pkgs.tree-sitter) version;
};
in
(let pkgs = import nixpkgs { }; in { defaultPackage = defaultPackage pkgs; }) // (flake-utils.lib.eachDefaultSystem
(system:
let pkgs = import nixpkgs { inherit system; }; in
{
defaultPackage = defaultPackage pkgs;
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nodejs
nodePackages.node-gyp
tree-sitter
];
};
}));
}