From 40257237a0597ddc7b59a443af8d1c1785644317 Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Mon, 27 May 2024 19:37:30 +0200 Subject: [PATCH] Fixed system --- flake.nix | 13 +++++-------- nix/zome.nix | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index 6beca51..186a110 100644 --- a/flake.nix +++ b/flake.nix @@ -68,19 +68,16 @@ { crateCargoToml, holochain, workspacePath, excludedCrates ? [ ] }: let deterministicCraneLib = let - # system =; - system = holochain.devShells.holonix.system; pkgs = import inputs.nixpkgs { system = "x86_64-linux"; overlays = [ (import inputs.rust-overlay) ]; }; - rustToolchain = - pkgs.rust-bin.stable."1.77.2".minimal.override { - # Set the build targets supported by the toolchain, - # wasm32-unknown-unknown is required for trunk. - targets = [ "wasm32-unknown-unknown" ]; - }; + rustToolchain = pkgs.rust-bin.stable."1.77.2".minimal.override { + # Set the build targets supported by the toolchain, + # wasm32-unknown-unknown is required for trunk. + targets = [ "wasm32-unknown-unknown" ]; + }; in (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain; system = holochain.devShells.holonix.system; diff --git a/nix/zome.nix b/nix/zome.nix index 3348dd4..86982db 100644 --- a/nix/zome.nix +++ b/nix/zome.nix @@ -36,23 +36,25 @@ let }); debug = runCommandLocal "${crate}-debug" { meta = { holochainPackageType = "zome"; }; - } "cp ${wasm}/lib/${crate}.wasm $out \n"; + } '' + cp ${wasm}/lib/${crate}.wasm $out + ''; deterministicWasm = let - wasmDeps = deterministicCraneLib.buildDepsOnly (commonArgs // { - inherit cargoExtraArgs; - pname = "happ-workspace"; - version = "workspace"; - }); + wasmDeps = deterministicCraneLib.buildDepsOnly (commonArgs // { + inherit cargoExtraArgs; + pname = "happ-workspace"; + version = "workspace"; + }); wasm = deterministicCraneLib.buildPackage (commonArgs // { - cargoArtifacts = wasmDeps; - cargoToml = crateCargoToml; + cargoArtifacts = wasmDeps; + cargoToml = crateCargoToml; cargoLock = workspacePath + /Cargo.lock; cargoExtraArgs = "-p ${crate} --locked"; pname = crate; version = cargoToml.package.version; - }); + }); in runCommandLocal "${crate}-deterministic" { meta = { holochainPackageType = "zome"; }; } " cp ${wasm}/lib/${crate}.wasm $out \n"; @@ -62,4 +64,6 @@ in runCommandNoCC crate { holochainPackageType = "zome"; }; buildInputs = [ binaryen ]; -} "wasm-opt --strip-debug -Oz -o $out ${deterministicWasm}\n" +} '' + wasm-opt --strip-debug -Oz -o $out ${deterministicWasm} +''