aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorKamen Mladenov <kamen@syndamia.com>2025-01-13 10:45:08 +0200
committerKamen Mladenov <kamen@syndamia.com>2025-01-13 10:45:08 +0200
commit07c565962194606d873ca14681c51a1cba048ec3 (patch)
tree22169c0b8dea7e1cbb97fcfa0d0ff07259099cc0 /flake.nix
parentf0870084c382617d9d51b7d448efafc4cc07a69f (diff)
downloadzkVMs-benchmarks-07c565962194606d873ca14681c51a1cba048ec3.tar
zkVMs-benchmarks-07c565962194606d873ca14681c51a1cba048ec3.tar.gz
zkVMs-benchmarks-07c565962194606d873ca14681c51a1cba048ec3.zip
feat: Generic build and install phases, which only compile instead of proving
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix31
1 files changed, 30 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 7299b4b..9f315ac 100644
--- a/flake.nix
+++ b/flake.nix
@@ -20,7 +20,36 @@
pkgs = import nixpkgs { system = system; overlays = [ mcl-blockchain.overlays.default ]; };
callPackage = pkgs.lib.callPackageWith pkgs;
+ withZKVMPhases = currentPackage: with currentPackage; {
+ buildPhase = ''
+ root_dir="$PWD"
+ runHook preBuild
+ cd "$root_dir"
+
+ export INPUTS="$PWD/Vertices-010.in"
+ cargo build --bin ${hostBin} --release
+
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ runHook preInstall
+ mkdir -p "$out"/bin
+ for bin in $(find . -type f -regex ".*release/[^/]*" -executable -print)
+ do
+ mv "$bin" "$out"/bin/
+ done
+ runHook postInstall
+ '';
+
+ doNotPostBuildInstallCargoBinaries = true;
+ } // currentPackage;
+
+ args-zkVM = {
+ craneLib-default = crane.mkLib pkgs;
+ inherit withZKVMPhases;
+ };
in {
- packages.${system}.risc0 = callPackage ./zkvms/risc0/default.nix {craneLib-default = crane.mkLib pkgs;};
+ packages.${system}.risc0 = callPackage ./zkvms/risc0/default.nix args-zkVM;
};
}