diff --git a/pkgs/by-name/pr/prometheus-kea-exporter/package.nix b/pkgs/by-name/pr/prometheus-kea-exporter/package.nix index 2b2cadba9b01..dc9c463886a0 100644 --- a/pkgs/by-name/pr/prometheus-kea-exporter/package.nix +++ b/pkgs/by-name/pr/prometheus-kea-exporter/package.nix @@ -1,19 +1,21 @@ { lib, python3Packages, - fetchPypi, + fetchFromGitHub, nixosTests, + versionCheckHook, }: -python3Packages.buildPythonApplication rec { +python3Packages.buildPythonApplication (finalAttrs: { pname = "kea-exporter"; - version = "0.7.0"; + version = "0.7.1"; pyproject = true; - src = fetchPypi { - pname = "kea_exporter"; - inherit version; - hash = "sha256-kn2iwYWcyW90tgfWmzLF7rU06fJyLRzqYKNLOgu/Yqk="; + src = fetchFromGitHub { + owner = "mweinelt"; + repo = "kea-exporter"; + tag = "v${finalAttrs.version}"; + hash = "sha256-UwQYR01cBdPEUBhOo5TqwmptAvJpxln1OLU2boAFdn4="; }; nativeBuildInputs = with python3Packages; [ @@ -26,21 +28,17 @@ python3Packages.buildPythonApplication rec { requests ]; - checkPhase = '' - $out/bin/kea-exporter --help > /dev/null - $out/bin/kea-exporter --version | grep -q ${version} - ''; - + nativeInstallCheckInputs = [ versionCheckHook ]; passthru.tests = { inherit (nixosTests) kea; }; meta = { - changelog = "https://github.com/mweinelt/kea-exporter/blob/v${version}/HISTORY"; + changelog = "https://github.com/mweinelt/kea-exporter/blob/v${finalAttrs.version}/HISTORY"; description = "Export Kea Metrics in the Prometheus Exposition Format"; mainProgram = "kea-exporter"; homepage = "https://github.com/mweinelt/kea-exporter"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ hexa ]; }; -} +})