Skip to content

Commit

Permalink
Fixed system
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed May 27, 2024
1 parent 5d4a4f8 commit 4025723
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
13 changes: 5 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
24 changes: 14 additions & 10 deletions nix/zome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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}
''

0 comments on commit 4025723

Please sign in to comment.