diff options
author | Robert Schütz <dev@schuetz-co.de> | 2021-03-08 10:09:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 10:09:30 +0100 |
commit | 6692b32105610b17efa5a00d8e5e87fd4be49734 (patch) | |
tree | ec9e9452f83f09b76450d19c3505e702d20446ab | |
parent | 2b74b052c0e776f85abdea91ecfcfb7cf87eeb0e (diff) | |
parent | 336c114214d07249815748bbefddf00a9edc8aa2 (diff) |
Merge pull request #112125 from dotlambda/alerta
alerta: move to all-packages.nix and use buildPythonApplication
-rw-r--r-- | nixos/modules/services/monitoring/alerta.nix | 4 | ||||
-rw-r--r-- | pkgs/development/python-modules/alerta/default.nix | 29 | ||||
-rw-r--r-- | pkgs/servers/monitoring/alerta/client.nix | 27 | ||||
-rw-r--r-- | pkgs/servers/monitoring/alerta/default.nix (renamed from pkgs/development/python-modules/alerta-server/default.nix) | 16 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 4 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 4 |
6 files changed, 39 insertions, 45 deletions
diff --git a/nixos/modules/services/monitoring/alerta.nix b/nixos/modules/services/monitoring/alerta.nix index 34f2d41706a5..7c6eff713cb1 100644 --- a/nixos/modules/services/monitoring/alerta.nix +++ b/nixos/modules/services/monitoring/alerta.nix @@ -95,13 +95,13 @@ in ALERTA_SVR_CONF_FILE = alertaConf; }; serviceConfig = { - ExecStart = "${pkgs.python36Packages.alerta-server}/bin/alertad run --port ${toString cfg.port} --host ${cfg.bind}"; + ExecStart = "${pkgs.alerta-server}/bin/alertad run --port ${toString cfg.port} --host ${cfg.bind}"; User = "alerta"; Group = "alerta"; }; }; - 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/development/python-modules/alerta-server/default.nix b/pkgs/servers/monitoring/alerta/default.nix index 82783dd16bb5..e69a594a728b 100644 --- a/pkgs/development/python-modules/alerta-server/default.nix +++ b/pkgs/servers/monitoring/alerta/default.nix @@ -1,17 +1,17 @@ -{ lib, buildPythonPackage, fetchPypi, pythonOlder -, bcrypt, blinker, flask, flask-compress, flask-cors, mohawk, psycopg2, pyjwt, pymongo, python-dateutil, pytz, pyyaml, requests, requests-hawk, sentry-sdk +{ lib +, python3 }: -buildPythonPackage rec { +python3.pkgs.buildPythonApplication rec { pname = "alerta-server"; version = "8.3.3"; - src = fetchPypi { + src = python3.pkgs.fetchPypi { inherit pname version; sha256 = "a2713a31c6e326c774a3ee0328f424f944b951935ff1b893a4a66598d61c5a97"; }; - propagatedBuildInputs = [ + propagatedBuildInputs = with python3.pkgs; [ bcrypt blinker flask @@ -31,11 +31,7 @@ buildPythonPackage rec { doCheck = false; # We can't run the tests from Nix, because they rely on the presence of a working MongoDB server - postInstall = '' - wrapProgram $out/bin/alertad --prefix PYTHONPATH : "$PYTHONPATH" - ''; - - disabled = pythonOlder "3.5"; + disabled = python3.pythonOlder "3.6"; meta = with lib; { homepage = "https://alerta.io"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c5823413ac6f..80e973fc02a1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17832,6 +17832,10 @@ 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 { }; apacheHttpd = pkgs.apacheHttpd_2_4; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 10d699e9ee1e..afd5583f4e32 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -334,10 +334,6 @@ in { alembic = callPackage ../development/python-modules/alembic { }; - alerta = callPackage ../development/python-modules/alerta { }; - - alerta-server = callPackage ../development/python-modules/alerta-server { }; - algebraic-data-types = callPackage ../development/python-modules/algebraic-data-types { }; allpairspy = callPackage ../development/python-modules/allpairspy { }; |