Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
inherit
(self'.legacyPackages)
rustPlatformStable
rustPlatformNightly
craneLib-stable
cardano-node
cardano-cli
Expand Down Expand Up @@ -103,6 +104,8 @@
};
polkadot = polkadot-generic {};
polkadot-fast = polkadot-generic {enableFastRuntime = true;};

zokrates = callPackage ./zokrates/default.nix {rustPlatform = rustPlatformNightly."2022-07-01";};
in {
legacyPackages.metacraft-labs =
rec {
Expand Down Expand Up @@ -148,6 +151,8 @@

# Polkadot
inherit polkadot polkadot-fast;

inherit zokrates;
}
// lib.optionalAttrs hostPlatform.isLinux rec {
wasmd = callPackage ./wasmd/default.nix {};
Expand Down
22 changes: 21 additions & 1 deletion packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
extensions = ["rust-src"];
targets = ["wasm32-wasi" "wasm32-unknown-unknown"];
};
rust-nightly = pkgs-extended.rust-bin.nightly.latest.default.override {
extensions = ["rust-src"];
targets = ["wasm32-wasi" "wasm32-unknown-unknown"];
};
rust-nightly-2022-07-01 = pkgs-extended.rust-bin.nightly."2022-07-01".default.override {
extensions = ["rust-src"];
targets = ["wasm32-wasi" "wasm32-unknown-unknown"];
};
in {
packages = self'.legacyPackages.metacraft-labs;

Expand All @@ -24,12 +32,24 @@
nix2container = inputs'.nix2container.packages.nix2container;
inherit (inputs'.cardano-node.packages) cardano-node cardano-cli;

inherit rust-stable craneLib-stable;
inherit rust-stable craneLib-stable rust-nightly;

rustPlatformStable = pkgs.makeRustPlatform {
rustc = rust-stable;
cargo = rust-stable;
};

rustPlatformNightly =
(pkgs.makeRustPlatform {
rustc = rust-nightly;
cargo = rust-nightly;
})
// {
"2022-07-01" = pkgs.makeRustPlatform {
rustc = rust-nightly-2022-07-01;
cargo = rust-nightly-2022-07-01;
};
};
};
};
}
31 changes: 31 additions & 0 deletions packages/zokrates/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
lib,
fetchgit,
pkgs,
rustPlatform,
}:
with pkgs;
rustPlatform.buildRustPackage rec {
pname = "zokrates";
version = "0.8.7";
cargoBuildFlags = "-p zokrates_cli";

src = fetchgit {
url = "https://github.com/Zokrates/ZoKrates.git";
rev = "0.8.7";
hash = "sha256-Ew7MYJg3Mxz05ngL0sZEuPijxzaHhliK9GIho1GTFr8=";
};

cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"ark-marlin-0.3.0" = "sha256-dc4StG8FEDrxVuo00M/uF6SRi5rpTx4I2PnmKtVJTLI=";
"phase2-0.2.2" = "sha256-eONGJEK6g2DN6dKL86vMVx/Md63u5E2Qzv4tpek0NzM=";
};
};

nativeBuildInputs = [pkg-config];
PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig";

buildInputs = [];
}
2 changes: 2 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ in

metacraft-labs.polkadot
metacraft-labs.polkadot-fast

metacraft-labs.zokrates
]
++ lib.optionals (stdenv.hostPlatform.isx86) [
metacraft-labs.rapidsnark
Expand Down