Skip to content

Commit

Permalink
nix: add wasm tooling to the default dev shell (#4495)
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln authored Dec 1, 2023
1 parent f2e5886 commit ff1752c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nix/all-engines.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let
src = srcPath;
name = "prisma-engines-source";
};
craneLib = (flakeInputs.crane.mkLib pkgs).overrideToolchain rustToolchain.default;
craneLib = (flakeInputs.crane.mkLib pkgs).overrideToolchain rustToolchain;
deps = craneLib.vendorCargoDeps { inherit src; };
libSuffix = stdenv.hostPlatform.extensions.sharedLibrary;
in
Expand Down
4 changes: 3 additions & 1 deletion nix/args.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
in rec
{
pkgs = import flakeInputs.nixpkgs { inherit system overlays; };
rustToolchain = pkgs.rust-bin.stable.latest;
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
targets = ["wasm32-unknown-unknown"];
};
};
}
11 changes: 8 additions & 3 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
{ self', pkgs, rustToolchain, ... }:

let
devToolchain = rustToolchain.default.override { extensions = [ "rust-analyzer" "rust-src" ]; };
devToolchain = rustToolchain.override { extensions = [ "rust-analyzer" "rust-src" ]; };
nodejs = pkgs.nodejs_latest;
in
{
devShells.default = pkgs.mkShell {
packages = [
packages = with pkgs; [
devToolchain
pkgs.llvmPackages_latest.bintools
llvmPackages_latest.bintools

nodejs
nodejs.pkgs.typescript-language-server
nodejs.pkgs.pnpm

jq
wasm-bindgen-cli
wasm-pack
];

inputsFrom = [ self'.packages.prisma-engines ];
shellHook = pkgs.lib.optionalString pkgs.stdenv.isLinux
"export RUSTFLAGS='-C link-arg=-fuse-ld=lld'";
Expand Down

0 comments on commit ff1752c

Please sign in to comment.