Skip to content

Commit

Permalink
Take Nickel grammar directly from the flake
Browse files Browse the repository at this point in the history
The tree-sitter Nickel grammar taken from Nixpkgs is too old and doesn't
match current queries, and the update process to upstream an update is
not obvious. In the meantime, we take the tree-sitter-nickel grammar
directly from the source repo - as a flake input - to ensure it's up to
date.
  • Loading branch information
yannham authored and nbacquey committed Nov 5, 2024
1 parent fd07cff commit 9c8bd40
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
7 changes: 6 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
, rust-overlay
, nix-filter
, craneLib
# tree-sitter-Nickel is packaged in Nixpkgs, but it's an older version at the
# time of writing. Since updating it seems non trivial, and we need Topiary to
# be compatible with Nickel urgently (it is currently blocking for the CI), we
# use the tree-sitter-nickel flake directly.
, tree-sitter-nickel
}:
let
wasmRustVersion = "1.77.2";
Expand Down Expand Up @@ -123,7 +128,7 @@ in
bash="${pkgs.tree-sitter-grammars.tree-sitter-bash}/parser" \
css="${pkgs.tree-sitter-grammars.tree-sitter-css}/parser" \
json="${pkgs.tree-sitter-grammars.tree-sitter-json}/parser" \
nickel="${pkgs.tree-sitter-grammars.tree-sitter-nickel}/parser" \
nickel="${tree-sitter-nickel}/parser" \
ocaml="${pkgs.tree-sitter-grammars.tree-sitter-ocaml}/parser" \
ocaml_interface="${pkgs.tree-sitter-grammars.tree-sitter-ocaml-interface}/parser" \
rust="${pkgs.tree-sitter-grammars.tree-sitter-rust}/parser" \
Expand Down
26 changes: 25 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@

flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";

tree-sitter-nickel-input = {
url = "github:nickel-lang/tree-sitter-nickel";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};

outputs = inputs:
Expand Down Expand Up @@ -55,7 +61,11 @@

craneLib = crane.mkLib pkgs;

topiaryPkgs = pkgs.callPackage ./default.nix { inherit advisory-db crane rust-overlay nix-filter craneLib; };
tree-sitter-nickel = tree-sitter-nickel-input.packages.${system}.default;

topiaryPkgs = pkgs.callPackage ./default.nix {
inherit advisory-db crane rust-overlay nix-filter craneLib tree-sitter-nickel;
};
binPkgs = pkgs.callPackage ./bin/default.nix { };
in
{
Expand Down

0 comments on commit 9c8bd40

Please sign in to comment.