diff --git a/codecs/resize/flake.lock b/codecs/resize/flake.lock index e134190c5..4cee021da 100644 --- a/codecs/resize/flake.lock +++ b/codecs/resize/flake.lock @@ -118,11 +118,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-ZBQyty6638OHI5UZBk79+VY3LOAO51OexUMn4AQWS3Y=", - "path": "/nix/store/v77iy474167bmkvc9glwhkxhi728nn88-source/nix/wasm-bindgen", + "path": "/nix/store/qmv8wrsh9s2i7z7b5a5iak6nark83267-source/nix/wasm-bindgen", "type": "path" }, "original": { - "path": "/nix/store/v77iy474167bmkvc9glwhkxhi728nn88-source/nix/wasm-bindgen", + "path": "/nix/store/qmv8wrsh9s2i7z7b5a5iak6nark83267-source/nix/wasm-bindgen", "type": "path" } } diff --git a/codecs/resize/flake.nix b/codecs/resize/flake.nix index 9219f9683..3a501ea69 100644 --- a/codecs/resize/flake.nix +++ b/codecs/resize/flake.nix @@ -31,9 +31,19 @@ ]; src = ./.; + rustPlatform = pkgs.makeRustPlatform { + cargo = toolchain; + rustc = toolchain; + }; + + cargoLockFile = "${src}/Cargo.lock"; + + vendor = rustPlatform.importCargoLock { + lockFile = cargoLockFile; + }; + wasm-bindgen-bin = wasm-bindgen.lib.buildFromCargoLock { - inherit system; - cargoLockFile = "${src}/Cargo.lock"; + inherit system cargoLockFile; sha256 = "sha256-HTElSB76gqCpDu8S0ZJlfd/S4ftMrbwxFgJM9OXBRz8="; }; in @@ -52,7 +62,11 @@ buildPhase = '' runHook preBuild export CARGO_HOME=$TMPDIR/.cargo - cargo build --target wasm32-unknown-unknown -r + cargo build \ + --config 'source.crates-io.replace-with="vendored-sources"' \ + --config 'source.vendored-sources.directory="${vendor}"' \ + --offline \ + --target ${target} -r wasm-bindgen --target web --out-dir $out ./target/wasm32-unknown-unknown/release/*.wasm runHook postBuild '';