python312Packages.types-aiobotocore: 2.15.2 -> 2.15.2.post3 (#361801)
[NixPkgs.git] / pkgs / by-name / pr / prometheus-restic-exporter / package.nix
blobd2dc4875282f09949508a1af074125a770a5f472
1 { lib
2 , stdenvNoCC
3 , fetchFromGitHub
4 , python3
5 , restic
6 , nixosTests
7 }:
9 stdenvNoCC.mkDerivation rec {
10   pname = "prometheus-restic-exporter";
11   version = "1.6.0";
13   src = fetchFromGitHub {
14     owner = "ngosang";
15     repo = "restic-exporter";
16     rev = version;
17     hash = "sha256-gXiEts0EY9H01+rs+2o+cbVENotM33uhcQiGDtroSU4=";
18   };
20   buildInputs = [
21     (python3.withPackages (ps: [ ps.prometheus-client ]))
22   ];
24   installPhase = ''
25     runHook preInstall
27     install -D -m0755 restic-exporter.py $out/bin/restic-exporter.py
29     substituteInPlace $out/bin/restic-exporter.py --replace-fail \"restic\" \"${lib.makeBinPath [ restic ]}/restic\"
31     patchShebangs $out/bin/restic-exporter.py
33     runHook postInstall
34   '';
36   passthru.tests = {
37     restic-exporter = nixosTests.prometheus-exporters.restic;
38   };
40   meta = with lib; {
41     description = "Prometheus exporter for the Restic backup system";
42     homepage = "https://github.com/ngosang/restic-exporter";
43     changelog = "https://github.com/ngosang/restic-exporter/blob/${src.rev}/CHANGELOG.md";
44     license = licenses.mit;
45     maintainers = with maintainers; [ minersebas ];
46     mainProgram = "restic-exporter.py";
47     platforms = platforms.all;
48   };