Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
51 lines
1.2 KiB
Nix
51 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;
|
|
};
|
|
}
|