nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 python3Packages,
4 fetchPypi,
5 nixosTests,
6}:
7
8python3Packages.buildPythonApplication rec {
9 pname = "kea-exporter";
10 version = "0.7.0";
11 pyproject = true;
12
13 src = fetchPypi {
14 pname = "kea_exporter";
15 inherit version;
16 hash = "sha256-kn2iwYWcyW90tgfWmzLF7rU06fJyLRzqYKNLOgu/Yqk=";
17 };
18
19 nativeBuildInputs = with python3Packages; [
20 pdm-backend
21 ];
22
23 propagatedBuildInputs = with python3Packages; [
24 click
25 prometheus-client
26 requests
27 ];
28
29 checkPhase = ''
30 $out/bin/kea-exporter --help > /dev/null
31 $out/bin/kea-exporter --version | grep -q ${version}
32 '';
33
34 passthru.tests = {
35 inherit (nixosTests) kea;
36 };
37
38 meta = {
39 changelog = "https://github.com/mweinelt/kea-exporter/blob/v${version}/HISTORY";
40 description = "Export Kea Metrics in the Prometheus Exposition Format";
41 mainProgram = "kea-exporter";
42 homepage = "https://github.com/mweinelt/kea-exporter";
43 license = lib.licenses.mit;
44 maintainers = with lib.maintainers; [ hexa ];
45 };
46}