diff options
Diffstat (limited to 'pkgs/development/tools/parsing/tree-sitter/update.nix')
-rw-r--r-- | pkgs/development/tools/parsing/tree-sitter/update.nix | 72 |
1 files changed, 39 insertions, 33 deletions
diff --git a/pkgs/development/tools/parsing/tree-sitter/update.nix b/pkgs/development/tools/parsing/tree-sitter/update.nix index b2267f33c7bf1..fffab5ea3f5fa 100644 --- a/pkgs/development/tools/parsing/tree-sitter/update.nix +++ b/pkgs/development/tools/parsing/tree-sitter/update.nix @@ -126,6 +126,10 @@ let orga = "MDeiml"; repo = "tree-sitter-markdown"; }; + "tree-sitter-proto" = { + orga = "mitchellh"; + repo = "tree-sitter-proto"; + }; "tree-sitter-rego" = { orga = "FallenAngel97"; repo = "tree-sitter-rego"; @@ -403,7 +407,8 @@ let jsonFile = name: val: (formats.json { }).generate name val; # implementation of the updater - updateImpl = passArgs "updateImpl-with-args" { + updateImpl = passArgs "updateImpl-with-args" + { binaries = { curl = "${curl}/bin/curl"; nix-prefetch-git = "${nix-prefetch-git}/bin/nix-prefetch-git"; @@ -414,9 +419,10 @@ let ignoredTreeSitterOrgRepos ; } - (writers.writePython3 "updateImpl" { - flakeIgnore = ["E501"]; - } ./update_impl.py); + (writers.writePython3 "updateImpl" + { + flakeIgnore = [ "E501" ]; + } ./update_impl.py); # Pass the given arguments to the command, in the ARGS environment variable. # The arguments are just a json object that should be available in the script. @@ -429,7 +435,7 @@ let lib.concatMapStringsSep "\n" f (lib.mapAttrsToList (k: v: { name = k; } // v) attrs); - jsonNewlines = lib.concatMapStringsSep "\n" (lib.generators.toJSON {}); + jsonNewlines = lib.concatMapStringsSep "\n" (lib.generators.toJSON { }); # Run the given script for each of the attr list. # The attrs are passed to the script as a json value. @@ -443,34 +449,34 @@ let outputDir = "${toString ./.}/grammars"; update-all-grammars = writeShellScript "update-all-grammars.sh" '' - set -euo pipefail - ${updateImpl} fetch-and-check-tree-sitter-repos '{}' - echo "writing files to ${outputDir}" 1>&2 - mkdir -p "${outputDir}" - ${forEachParallel - "repos-to-fetch" - (writeShellScript "fetch-repo" '' - ${updateImpl} fetch-repo "$1" - '') - (lib.mapAttrsToList - (nixRepoAttrName: attrs: attrs // { - inherit - nixRepoAttrName - outputDir; - }) - allGrammars) - } - ${updateImpl} print-all-grammars-nix-file "$(< ${ - jsonFile "all-grammars.json" { - allGrammars = - (lib.mapAttrsToList - (nixRepoAttrName: attrs: attrs // { - inherit nixRepoAttrName; - }) - allGrammars); - inherit outputDir; - } - })" + set -euo pipefail + ${updateImpl} fetch-and-check-tree-sitter-repos '{}' + echo "writing files to ${outputDir}" 1>&2 + mkdir -p "${outputDir}" + ${forEachParallel + "repos-to-fetch" + (writeShellScript "fetch-repo" '' + ${updateImpl} fetch-repo "$1" + '') + (lib.mapAttrsToList + (nixRepoAttrName: attrs: attrs // { + inherit + nixRepoAttrName + outputDir; + }) + allGrammars) + } + ${updateImpl} print-all-grammars-nix-file "$(< ${ + jsonFile "all-grammars.json" { + allGrammars = + (lib.mapAttrsToList + (nixRepoAttrName: attrs: attrs // { + inherit nixRepoAttrName; + }) + allGrammars); + inherit outputDir; + } + })" ''; |