about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/fr/fritz-exporter/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/fr/fritz-exporter/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/fr/fritz-exporter/package.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/fr/fritz-exporter/package.nix b/nixpkgs/pkgs/by-name/fr/fritz-exporter/package.nix
new file mode 100644
index 000000000000..3306802b840f
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/fr/fritz-exporter/package.nix
@@ -0,0 +1,52 @@
+{ lib
+, python3
+, fetchFromGitHub
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "fritz-exporter";
+  version = "2.3.1";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "pdreker";
+    repo = "fritz_exporter";
+    rev = "fritzexporter-v${version}";
+    hash = "sha256-Dv/2Og1OJV7canZ8Y5Pai5gPRUvcRDYmSGoD2pnAkSs=";
+  };
+
+  patches = [
+    # https://github.com/pdreker/fritz_exporter/pull/282
+    ./console-script.patch
+  ];
+
+  postPatch = ''
+    # don't test coverage
+    sed -i "/^addopts/d" pyproject.toml
+  '';
+
+  nativeBuildInputs = with python3.pkgs; [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    attrs
+    fritzconnection
+    prometheus-client
+    pyyaml
+    requests
+  ];
+
+  nativeCheckInputs = with python3.pkgs; [
+    pytestCheckHook
+  ];
+
+  meta = {
+    changelog = "https://github.com/pdreker/fritz_exporter/blob/${src.rev}/CHANGELOG.md";
+    description = "Prometheus exporter for Fritz!Box home routers";
+    homepage = "https://github.com/pdreker/fritz_exporter";
+    license = lib.licenses.asl20;
+    mainProgram = "fritzexporter";
+    maintainers = with lib.maintainers; [ marie ];
+  };
+}