From 72e3b2e2e6e06492e941075e1b34dde85ea5e202 Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Thu, 22 Feb 2024 16:56:14 +0100 Subject: [PATCH] Attempt --- nix/zome.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nix/zome.nix b/nix/zome.nix index 2d774a4..a8adcd0 100644 --- a/nix/zome.nix +++ b/nix/zome.nix @@ -1,5 +1,4 @@ { - crate, stdenv, binaryen, craneLib, @@ -11,6 +10,11 @@ let cargoExtraArgs = "--workspace ${if excludedCrates != null then builtins.concatStringsSep " " (builtins.map (excludedCrate: ''--exclude ${excludedCrate}'') excludedCrates) else ''''}"; + + cargoToml = cratePath + /Cargo.toml; + crateToml = builtins.fromTOML (builtins.readFile cargoToml); + crate = crateToml.package.name; + wasmDeps = craneLib.buildDepsOnly { inherit cargoExtraArgs; src = craneLib.cleanCargoSource (craneLib.path workspacePath); @@ -18,8 +22,8 @@ let doCheck = false; }; wasm = craneLib.buildPackage { + inherit cargoToml; src = craneLib.cleanCargoSource (craneLib.path cratePath); - cargoToml = cratePath + /Cargo.toml; cargoLock = workspacePath + /Cargo.lock; CARGO_BUILD_TARGET = "wasm32-unknown-unknown"; cargoArtifacts = wasmDeps;