From d3657f676638ef8e8e024998b26a7d46e922d481 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Oct 2018 00:45:25 +0200 Subject: [PATCH 1/2] speedtest-cli: move ot python-modules --- .../python-modules/speedtest-cli/default.nix | 26 +++++++++++++++++++ .../networking/speedtest-cli/default.nix | 21 --------------- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/python-packages.nix | 2 ++ 4 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 pkgs/development/python-modules/speedtest-cli/default.nix delete mode 100644 pkgs/tools/networking/speedtest-cli/default.nix diff --git a/pkgs/development/python-modules/speedtest-cli/default.nix b/pkgs/development/python-modules/speedtest-cli/default.nix new file mode 100644 index 000000000000..f2c38a3414ba --- /dev/null +++ b/pkgs/development/python-modules/speedtest-cli/default.nix @@ -0,0 +1,26 @@ +{ lib +, buildPythonPackage +, fetchPypi +}: + +# cannot be built as pythonApplication because the library functions are +# required for home-assistant +buildPythonPackage rec { + pname = "speedtest-cli"; + version = "2.0.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "2f3d5aa1086d9b367c03b99db6e3207525af174772d877c6b982289b8d2bdefe"; + }; + + # tests require working internet connection + doCheck = false; + + meta = with lib; { + description = "Command line interface for testing internet bandwidth using speedtest.net"; + homepage = https://github.com/sivel/speedtest-cli; + license = licenses.asl20; + maintainers = with maintainers; [ makefu domenkozar ndowens ]; + }; +} diff --git a/pkgs/tools/networking/speedtest-cli/default.nix b/pkgs/tools/networking/speedtest-cli/default.nix deleted file mode 100644 index eedea841356d..000000000000 --- a/pkgs/tools/networking/speedtest-cli/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ stdenv, fetchFromGitHub, python3Packages }: - -python3Packages.buildPythonApplication rec { - name = "speedtest-cli-${version}"; - version = "2.0.2"; - - src = fetchFromGitHub { - owner = "sivel"; - repo = "speedtest-cli"; - rev = "v${version}"; - sha256 = "0vv2z37g2kgm2dzkfa4bhri92hs0d1acxi8z66gznsl5148q7sdi"; - }; - - meta = with stdenv.lib; { - homepage = https://github.com/sivel/speedtest-cli; - description = "Command line interface for testing internet bandwidth using speedtest.net"; - platforms = platforms.all; - license = licenses.asl20; - maintainers = with maintainers; [ domenkozar ndowens ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2c118561c8b7..bd1f0fbd2e83 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8784,7 +8784,7 @@ with pkgs; sparse = callPackage ../development/tools/analysis/sparse { }; - speedtest-cli = callPackage ../tools/networking/speedtest-cli { }; + speedtest-cli = with python3Packages; toPythonApplication speedtest-cli; spin = callPackage ../development/tools/analysis/spin { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ee1bee109a3f..4087b58bd487 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15458,6 +15458,8 @@ EOF }; }; + speedtest-cli = callPackage ../development/python-modules/speedtest-cli { }; + pushbullet = callPackage ../development/python-modules/pushbullet { }; power = buildPythonPackage rec { From f0c643a99e8813df39bcff497ccf29361a26fe88 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Oct 2018 00:51:39 +0200 Subject: [PATCH 2/2] home-assistant: add speedtest-cli to component-packages --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index a67de2dab1aa..c1b35946d684 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -998,7 +998,7 @@ "sensor.sochain" = ps: with ps; [ ]; "sensor.socialblade" = ps: with ps; [ ]; "sensor.sonarr" = ps: with ps; [ ]; - "sensor.speedtest" = ps: with ps; [ ]; + "sensor.speedtest" = ps: with ps; [ speedtest-cli ]; "sensor.spotcrime" = ps: with ps; [ ]; "sensor.sql" = ps: with ps; [ sqlalchemy ]; "sensor.startca" = ps: with ps; [ xmltodict ];