depot/third_party/nixpkgs/pkgs/by-name/pr/prometheus-restic-exporter/package.nix
Luke Granger-Brown f92e137cfb
Some checks failed
/ combine-systems (push) Blocked by required conditions
/ build (x86_64-linux) (push) Failing after 11m44s
/ build (aarch64-linux) (push) Failing after 11m50s
/ build (push) Failing after 16m42s
Merge commit '1e2ed035f4bebc9adad02b365508ad96f7df87c1' into HEAD
2025-03-02 02:23:32 +00:00

50 lines
1.2 KiB
Nix

{
lib,
stdenvNoCC,
fetchFromGitHub,
python3,
restic,
nixosTests,
}:
stdenvNoCC.mkDerivation rec {
pname = "prometheus-restic-exporter";
version = "1.7.0";
src = fetchFromGitHub {
owner = "ngosang";
repo = "restic-exporter";
rev = version;
hash = "sha256-b3TbBZqNJEAveNVf+6OGHU2G3UUyuSEjzFMPJVuxlBE=";
};
buildInputs = [
(python3.withPackages (ps: [ ps.prometheus-client ]))
];
installPhase = ''
runHook preInstall
install -D -m0755 restic-exporter.py $out/bin/restic-exporter.py
substituteInPlace $out/bin/restic-exporter.py --replace-fail \"restic\" \"${lib.makeBinPath [ restic ]}/restic\"
patchShebangs $out/bin/restic-exporter.py
runHook postInstall
'';
passthru.tests = {
restic-exporter = nixosTests.prometheus-exporters.restic;
};
meta = with lib; {
description = "Prometheus exporter for the Restic backup system";
homepage = "https://github.com/ngosang/restic-exporter";
changelog = "https://github.com/ngosang/restic-exporter/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ minersebas ];
mainProgram = "restic-exporter.py";
platforms = platforms.all;
};
}