summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-01-19 16:36:39 +0100
committerGitHub <noreply@github.com>2022-01-19 16:36:39 +0100
commitf2fe7b9b525a4e553bcb1d554e7d235beb1fe133 (patch)
treefff2f9f52b72ed4f54f6d6002229eef86c9e1bd8
parent5dcd3d078d030adcfe9130b42da73595c1184f54 (diff)
parent43d6dbd4880b900f61799aa1a91e135e8653c3b2 (diff)
downloadnixpkgs-f2fe7b9b525a4e553bcb1d554e7d235beb1fe133.tar
nixpkgs-f2fe7b9b525a4e553bcb1d554e7d235beb1fe133.tar.gz
nixpkgs-f2fe7b9b525a4e553bcb1d554e7d235beb1fe133.tar.bz2
nixpkgs-f2fe7b9b525a4e553bcb1d554e7d235beb1fe133.tar.lz
nixpkgs-f2fe7b9b525a4e553bcb1d554e7d235beb1fe133.tar.xz
nixpkgs-f2fe7b9b525a4e553bcb1d554e7d235beb1fe133.tar.zst
nixpkgs-f2fe7b9b525a4e553bcb1d554e7d235beb1fe133.zip
Merge pull request #145204 from LucaFulchir/pynut2
-rw-r--r--maintainers/maintainer-list.nix6
-rw-r--r--pkgs/development/python-modules/pynut2/default.nix36
-rw-r--r--pkgs/servers/home-assistant/component-packages.nix2
-rw-r--r--pkgs/top-level/python-packages.nix2
4 files changed, 45 insertions, 1 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 1d4a63dd030..1cf7513d65e 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -7170,6 +7170,12 @@
     githubId = 13791;
     name = "Luke Gorrie";
   };
+  luker = {
+    email = "luker@fenrirproject.org";
+    github = "LucaFulchir";
+    githubId = 2486026;
+    name = "Luca Fulchir";
+  };
   lumi = {
     email = "lumi@pew.im";
     github = "lumi-me-not";
diff --git a/pkgs/development/python-modules/pynut2/default.nix b/pkgs/development/python-modules/pynut2/default.nix
new file mode 100644
index 00000000000..a530007e91e
--- /dev/null
+++ b/pkgs/development/python-modules/pynut2/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, requests
+#, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "pynut2";
+  version = "2.1.2";
+
+  src = fetchFromGitHub {
+    owner = "mezz64";
+    repo = "python-nut2";
+    rev = version;
+    sha256 = "1lg7n1frndfgw73s0ssl1h7kc6zxm7fpiwlc6v6d60kxzaj1dphx";
+  };
+
+  propagatedBuildInputs = [
+    requests
+  ];
+
+  # tests are completely broken, wrong imports and old api
+  #checkInputs = [
+  #  pytestCheckHook
+  #];
+
+  pythonImportsCheck = [ "pynut2.nut2" ];
+
+  meta = with lib; {
+    description = "API overhaul of PyNUT, a Python library to allow communication with NUT (Network UPS Tools) servers.";
+    homepage = "https://github.com/mezz64/python-nut2";
+    license = with licenses; [ gpl3Plus ];
+    maintainers = [ maintainers.luker ];
+  };
+}
diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix
index 8888fba7b74..9d6a55b57ac 100644
--- a/pkgs/servers/home-assistant/component-packages.nix
+++ b/pkgs/servers/home-assistant/component-packages.nix
@@ -589,7 +589,7 @@
     "nuki" = ps: with ps; [ pynuki ];
     "numato" = ps: with ps; [ ]; # missing inputs: numato-gpio
     "number" = ps: with ps; [ ];
-    "nut" = ps: with ps; [ ]; # missing inputs: pynut2
+    "nut" = ps: with ps; [ pynut2 ];
     "nws" = ps: with ps; [ pynws ];
     "nx584" = ps: with ps; [ pynx584 ];
     "nzbget" = ps: with ps; [ ]; # missing inputs: pynzbgetapi
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 09b2a3756cd..bdfdb7fdf6d 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -6052,6 +6052,8 @@ in {
 
   pynuki = callPackage ../development/python-modules/pynuki { };
 
+  pynut2 = callPackage ../development/python-modules/pynut2 { };
+
   pynws = callPackage ../development/python-modules/pynws { };
 
   pynx584 = callPackage ../development/python-modules/pynx584 { };