From 336c114214d07249815748bbefddf00a9edc8aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 6 Feb 2021 11:43:57 +0100 Subject: [PATCH] alerta: move to all-packages.nix and use buildPythonApplication --- nixos/modules/services/monitoring/alerta.nix | 2 +- .../python-modules/alerta/default.nix | 29 ------------------- pkgs/servers/monitoring/alerta/client.nix | 27 +++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ pkgs/top-level/python-packages.nix | 2 -- 5 files changed, 30 insertions(+), 32 deletions(-) delete mode 100644 pkgs/development/python-modules/alerta/default.nix create mode 100644 pkgs/servers/monitoring/alerta/client.nix diff --git a/nixos/modules/services/monitoring/alerta.nix b/nixos/modules/services/monitoring/alerta.nix index 5bbc9ba1e847..7c6eff713cb1 100644 --- a/nixos/modules/services/monitoring/alerta.nix +++ b/nixos/modules/services/monitoring/alerta.nix @@ -101,7 +101,7 @@ in }; }; - environment.systemPackages = [ pkgs.python36Packages.alerta ]; + environment.systemPackages = [ pkgs.alerta ]; users.users.alerta = { uid = config.ids.uids.alerta; diff --git a/pkgs/development/python-modules/alerta/default.nix b/pkgs/development/python-modules/alerta/default.nix deleted file mode 100644 index ad80f62db055..000000000000 --- a/pkgs/development/python-modules/alerta/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi -, six, click, requests, requests-hawk, pytz, tabulate, pythonOlder -}: - -buildPythonPackage rec { - pname = "alerta"; - version = "8.4.0"; - - src = fetchPypi { - inherit pname version; - sha256 = "260ff3118e73396104129928217b0f317ac5afdff8221874d8986df22ecf5f34"; - }; - - propagatedBuildInputs = [ six click requests requests-hawk pytz tabulate ]; - - doCheck = false; - - postInstall = '' - wrapProgram $out/bin/alerta --prefix PYTHONPATH : "$PYTHONPATH" - ''; - - disabled = pythonOlder "3.5"; - - meta = with lib; { - homepage = "https://alerta.io"; - description = "Alerta Monitoring System command-line interface"; - license = licenses.asl20; - }; -} diff --git a/pkgs/servers/monitoring/alerta/client.nix b/pkgs/servers/monitoring/alerta/client.nix new file mode 100644 index 000000000000..31f31d074057 --- /dev/null +++ b/pkgs/servers/monitoring/alerta/client.nix @@ -0,0 +1,27 @@ +{ lib +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "alerta"; + version = "8.4.0"; + + src = python3.pkgs.fetchPypi { + inherit pname version; + sha256 = "260ff3118e73396104129928217b0f317ac5afdff8221874d8986df22ecf5f34"; + }; + + propagatedBuildInputs = with python3.pkgs; [ + six click requests requests-hawk pytz tabulate + ]; + + doCheck = false; + + disabled = python3.pythonOlder "3.6"; + + meta = with lib; { + homepage = "https://alerta.io"; + description = "Alerta Monitoring System command-line interface"; + license = licenses.asl20; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 74522334756c..98f82a40bfa9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17733,6 +17733,8 @@ in adguardhome = callPackage ../servers/adguardhome {}; + alerta = callPackage ../servers/monitoring/alerta/client.nix { }; + alerta-server = callPackage ../servers/monitoring/alerta { }; apacheHttpd_2_4 = callPackage ../servers/http/apache-httpd/2.4.nix { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3ef26b4ee35c..a77eecf137c6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -322,8 +322,6 @@ in { alembic = callPackage ../development/python-modules/alembic { }; - alerta = callPackage ../development/python-modules/alerta { }; - algebraic-data-types = callPackage ../development/python-modules/algebraic-data-types { }; allpairspy = callPackage ../development/python-modules/allpairspy { };