diff options
Diffstat (limited to 'update-nix-dependencies.nix')
| -rw-r--r-- | update-nix-dependencies.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/update-nix-dependencies.nix b/update-nix-dependencies.nix new file mode 100644 index 0000000..e3e4275 --- /dev/null +++ b/update-nix-dependencies.nix @@ -0,0 +1,37 @@ +{ writeShellApplication, cargo, }: +writeShellApplication { + name = "update_nix_dependencies"; + + runtimeInputs = [ cargo ]; + + text = '' + updateCrate() { + sed -i "s|/nix/store/[^-]\+-$1-[^/]\+|$2|" Cargo.toml + } + + cd zkvms + for zkvm in * + do + [ ! -d "$zkvm" ] || [ "$zkvm" == 'result' ] && continue + [ "$zkvm" == 'zkwasm' ] && continue + pushd "$zkvm" + newPath="$(nix build github:metacraft-labs/nix-blockchain-development#"$zkvm" --print-out-paths)" + + [ "$zkvm" == 'nexus' ] && zkvm=Nexus + + cd guest + updateCrate "$zkvm" "$newPath" + cd ../host + updateCrate "$zkvm" "$newPath" + cd ../wrapper_macro + updateCrate "$zkvm" "$newPath" + + cd ../guest + cargo generate-lockfile + cd ../host + cargo generate-lockfile + + popd + done + ''; +} |
