nixfiles/pkgs/librespeed-rust/default.nix

37 lines
788 B
Nix
Raw Normal View History

2024-09-24 23:56:26 +02:00
{
lib,
fetchFromGitHub,
rustPlatform,
}:
let
version = "1.3.2";
src = fetchFromGitHub {
owner = "librespeed";
repo = "speedtest-rust";
rev = "refs/tags/v${version}";
hash = "sha256-z3lORjjJ89o+Du4mvKGydwxHU6Ra2jU5ue5Zsl/oIfY=";
};
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 ];
};
}