diff options
author | Robert Schütz <nix@dotlambda.de> | 2024-01-17 18:50:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 18:50:15 +0100 |
commit | d544ea1479069c49c8a8c77981551ca6024a817c (patch) | |
tree | 73734c2b604d0beb7837538d37b743e511070749 /pkgs/by-name/fr | |
parent | d6df8ae38e5c292a0e6480e1e9aea51423df9bdc (diff) | |
parent | 9a56e7c084daefa591bca5b681f65e4992cee441 (diff) |
Merge pull request #280595 from dotlambda/fritz-exporter-init
fritz-exporter: init at 2.3.1
Diffstat (limited to 'pkgs/by-name/fr')
-rw-r--r-- | pkgs/by-name/fr/fritz-exporter/console-script.patch | 14 | ||||
-rw-r--r-- | pkgs/by-name/fr/fritz-exporter/package.nix | 52 |
2 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/by-name/fr/fritz-exporter/console-script.patch b/pkgs/by-name/fr/fritz-exporter/console-script.patch new file mode 100644 index 0000000000000..e13e78f2d184a --- /dev/null +++ b/pkgs/by-name/fr/fritz-exporter/console-script.patch @@ -0,0 +1,14 @@ +diff --git a/pyproject.toml b/pyproject.toml +index ffad1a4..e7551da 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -44,6 +44,9 @@ coverage = ">=6.4.4,<8.0.0" + pytest-cov = ">=3,<5" + ruff = "^0.1.7" + ++[tool.poetry.scripts] ++fritzexporter = "fritzexporter.__main__:main" ++ + [build-system] + requires = ["poetry-core"] + build-backend = "poetry.core.masonry.api" diff --git a/pkgs/by-name/fr/fritz-exporter/package.nix b/pkgs/by-name/fr/fritz-exporter/package.nix new file mode 100644 index 0000000000000..3306802b840f5 --- /dev/null +++ b/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 ]; + }; +} |