build: pin nostr-bench submodule in nix and cloud bench pipeline

This commit is contained in:
2026-03-20 17:07:35 +01:00
parent 6b59fa6328
commit 8f22eb2097
8 changed files with 83 additions and 18 deletions

View File

@@ -1,22 +1,19 @@
{
lib,
fetchFromGitHub,
rustPlatform,
pkgsCross,
runCommand,
staticX86_64Musl ? false,
nostrBenchSrc ? ./nostr-bench,
}: let
selectedRustPlatform =
if staticX86_64Musl
then pkgsCross.musl64.rustPlatform
else rustPlatform;
srcBase = fetchFromGitHub {
owner = "rnostr";
repo = "nostr-bench";
rev = "d3ab701512b7c871707b209ef3f934936e407963";
hash = "sha256-F2qg1veO1iNlVUKf1b/MV+vexiy4Tt+w2aikDDbp7tU=";
};
# Keep the submodule path as-is so devenv can evaluate it correctly.
# `lib.cleanSource` treats submodule contents as untracked in this context.
srcBase = nostrBenchSrc;
src =
if staticX86_64Musl
@@ -31,7 +28,7 @@ in
selectedRustPlatform.buildRustPackage (
{
pname = "nostr-bench";
version = "0.4.0";
version = "0.5.0-parrhesia";
inherit src;
@@ -46,11 +43,11 @@ in
};
}
// lib.optionalAttrs staticX86_64Musl {
cargoHash = "sha256-aL8XSBJ8sHl7CGh9SkOoI+WlAHKrdij2DfvZAWIKgKY=";
cargoHash = "sha256-098BUjDLiezoFXs7fF+w7NQM+DPPfHMo1HGx3nV2UZM=";
CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl";
RUSTFLAGS = "-C target-feature=+crt-static";
}
// lib.optionalAttrs (!staticX86_64Musl) {
cargoHash = "sha256-mh9UdYhZl6JVJEeDFnY5BjfcK+PrWBBEn1Qh7/ZX17k=";
cargoHash = "sha256-x2pnxJL2nwni4cpSaUerDOfhdcTKJTyABYjPm96dAC0=";
}
)