2021-07-16 19:40:57 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "ookla-speedtest";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.1.1";
|
2021-07-16 19:40:57 +00:00
|
|
|
|
|
|
|
srcs = {
|
|
|
|
x86_64-linux = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://install.speedtest.net/app/cli/${pname}-${version}-linux-x86_64.tgz";
|
|
|
|
sha256 = "sha256-lwR3/f7k10HnXwiPr2SPm1HHvgQxP7iP+13gfrGjBAw=";
|
2021-07-16 19:40:57 +00:00
|
|
|
};
|
|
|
|
aarch64-linux = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://install.speedtest.net/app/cli/${pname}-${version}-linux-aarch64.tgz";
|
|
|
|
sha256 = "sha256-J2pAhz/hw8okohWAwvxkqpLtNY/8bbYHGhPQOo1DH9k=";
|
2021-07-16 19:40:57 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit pname version;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
2021-07-16 19:40:57 +00:00
|
|
|
|
|
|
|
setSourceRoot = ''
|
|
|
|
sourceRoot=$PWD
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D speedtest $out/bin/speedtest
|
|
|
|
install -D speedtest.5 $out/share/man/man5/speedtest.5
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Command line internet speedtest tool by Ookla";
|
|
|
|
homepage = "https://www.speedtest.net/apps/cli";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ kranzes ];
|
|
|
|
platforms = lib.attrNames srcs;
|
|
|
|
};
|
|
|
|
}
|