ch9344: 2.0 -> 0-unstable-2024-11-15 (#354536)
[NixPkgs.git] / pkgs / servers / monitoring / prometheus / sabnzbd-exporter.nix
blob05034b4b33276578df980bd3407c2d528fb7a729
2   lib,
3   fetchFromGitHub,
4   python3Packages,
5   nixosTests,
6 }:
8 python3Packages.buildPythonApplication rec {
9   pname = "sabnzbd_exporter";
10   version = "0.1.78";
12   format = "other";
14   src = fetchFromGitHub {
15     owner = "msroest";
16     repo = pname;
17     rev = "refs/tags/${version}";
18     hash = "sha256-BLqG2I7D/bqRj6+/LUKOimmTRTH/kRdukkGdOJT3+PA=";
19   };
21   propagatedBuildInputs = with python3Packages; [
22     prometheus-client
23     requests
24   ];
26   installPhase = ''
27     runHook preInstall
29     mkdir -p $out/bin
30     cp sabnzbd_exporter.py $out/bin/
32     mkdir -p $out/share/${pname}
33     cp examples/* $out/share/${pname}/
35     runHook postInstall
36   '';
38   passthru.tests = {
39     inherit (nixosTests.prometheus-exporters) sabnzbd;
40   };
42   meta = with lib; {
43     description = "Prometheus exporter for sabnzbd";
44     homepage = "https://github.com/msroest/sabnzbd_exporter";
45     license = licenses.mit;
46     maintainers = with maintainers; [ fugi ];
47     platforms = platforms.all;
48     mainProgram = "sabnzbd_exporter.py";
49   };