nixfiles/pkgs/librespeed-rust/default.nix
2024-10-02 12:54:44 +02:00

39 lines
912 B
Nix

{
lib,
fetchFromGitHub,
rustPlatform,
}:
let
# https://github.com/librespeed/speedtest-rust/pull/7
version = "unstable-2024-09-28";
src = fetchFromGitHub {
owner = "librespeed";
repo = "speedtest-rust";
rev = "a74f25d07da3eb665ce806e015c537264f7254c9";
hash = "sha256-+G1DFHQONXXg/5apSBlBkRvuLT4qCJaeFnQSLWt0CD0=";
};
in
rustPlatform.buildRustPackage {
pname = "librespeed-rust";
inherit version src;
cargoLock.lockFile = "${src}/Cargo.lock";
# error: linker `aarch64-linux-gnu-gcc` not found
postPatch = ''
rm .cargo/config.toml
'';
postInstall = ''
cp -r assets $out/
'';
meta = {
description = "A very lightweight speed test implementation in Rust.";
homepage = "https://github.com/librespeed/speedtest-rust";
license = lib.licenses.lgpl3Plus;
maintainers = with lib.maintainers; [ snaki ];
mainProgram = "librespeed-rs";
};
}