Fix 'nix flake check'
All checks were successful
continuous-integration/drone Build is passing

Turns out that 'tree-sitter' is not wrapped to have node and a compiler
available, because nixpkgs assumes that grammars already include
generated files.

So wrap it manually and use that in our pre-commit/checks.
This commit is contained in:
Bruno BELANYI 2022-06-03 15:56:32 +02:00
parent 02f89ac524
commit 752f941589

View file

@ -53,6 +53,26 @@
inherit system; inherit system;
overlays = [ self.overlays.default ]; overlays = [ self.overlays.default ];
}; };
tree-sitter-env = pkgs.stdenv.mkDerivation {
name = "tree-sitter-env";
nativeBuildInputs = with pkgs; [
makeWrapper
];
dontUnpack = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
makeWrapper \
${pkgs.tree-sitter}/bin/tree-sitter \
$out/bin/tree-sitter \
--prefix PATH : "${with pkgs; lib.makeBinPath [stdenv.cc nodejs]}"
'';
};
in in
rec { rec {
checks = { checks = {
@ -77,14 +97,14 @@
tree-sitter = { tree-sitter = {
enable = true; enable = true;
name = "tree-sitter tests"; name = "tree-sitter tests";
entry = "${pkgs.tree-sitter}/bin/tree-sitter test"; entry = "${tree-sitter-env}/bin/tree-sitter test";
pass_filenames = false; pass_filenames = false;
}; };
tree-sitter-files = { tree-sitter-files = {
enable = true; enable = true;
name = "tree-sitter generated files"; name = "tree-sitter generated files";
entry = "${pkgs.tree-sitter}/bin/tree-sitter generate"; entry = "${tree-sitter-env}/bin/tree-sitter generate";
pass_filenames = false; pass_filenames = false;
}; };
}; };