Skip to content

Commit

Permalink
add a script to put create the vendor dir
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Mar 3, 2022
1 parent 1c6234c commit d7671d4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/result
/target
/vendor
19 changes: 19 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@
pkgs = import inputs.nixpkgs { inherit system; };
naersk-lib = inputs.naersk.lib."${system}";
darwinInputs = if pkgs.stdenv.isDarwin then [ pkgs.xcbuild ] else [ ];

updateVendor = pkgs.writeShellScriptBin "update-vendor" ''
set -euo pipefail
rm -rf vendor
mkdir vendor
ln -s ${inputs.tree-sitter-cpp} vendor/tree-sitter-cpp
ln -s ${inputs.tree-sitter-elixir} vendor/tree-sitter-elixir
ln -s ${inputs.tree-sitter-elm} vendor/tree-sitter-elm
ln -s ${inputs.tree-sitter-haskell} vendor/tree-sitter-haskell
ln -s ${inputs.tree-sitter-javascript} vendor/tree-sitter-javascript
ln -s ${inputs.tree-sitter-php} vendor/tree-sitter-php
ln -s ${inputs.tree-sitter-ruby} vendor/tree-sitter-ruby
ln -s ${inputs.tree-sitter-rust} vendor/tree-sitter-rust
ln -s ${inputs.tree-sitter-typescript} vendor/tree-sitter-typescript
'';
in rec {
# `nix build`
packages.tree-grepper = naersk-lib.buildPackage {
Expand Down Expand Up @@ -87,6 +104,8 @@
rustc
rustfmt

updateVendor

# for some reason this seems to be required, especially on macOS
libiconv
] ++ darwinInputs;
Expand Down

0 comments on commit d7671d4

Please sign in to comment.