@@ -0,0 +1,52 @@
1+{ lib, buildGoModule, fetchFromGitHub, testers, runitor }:
2+
3+buildGoModule rec {
4+ pname = "runitor";
5+ version = "0.9.2";
6+ vendorSha256 = null;
7+
8+ src = fetchFromGitHub {
9+ owner = "bdd";
10+ repo = "runitor";
11+ rev = "v${version}";
12+ sha256 = "sha256-LuCxn4j0MlnJjSh3d18YNzNrtbqtMPxgkZttqKUGJd4";
13+ };
14+
15+ ldflags = [
16+ "-s" "-w" "-X main.Version=v${version}"
17+ ];
18+
19+ # TODO(cole-h):
20+ # End-to-end tests requiring localhost networking currently under
21+ # OfBorg's Linux builders, while passing under Darwin.
22+ #
23+ # Ref: https://github.com/NixOS/nixpkgs/pull/170566#issuecomment-1114034891
24+ #
25+ # Temporarily disable tests.
26+ doCheck = false;
27+
28+ passthru.tests.version = testers.testVersion {
29+ package = runitor;
30+ command = "runitor -version";
31+ version = "v${version}";
32+ };
33+
34+ # Unit tests require binding to local addresses for listening sockets.
35+ __darwinAllowLocalNetworking = true;
36+
37+ meta = with lib; {
38+ homepage = "https://bdd.fi/x/runitor";
39+ description = "A command runner with healthchecks.io integration";
40+ longDescription = ''
41+ Runitor runs the supplied command, captures its output, and based on its exit
42+ code reports successful or failed execution to https://healthchecks.io or your
43+ private instance.
44+
45+ Healthchecks.io is a web service for monitoring periodic tasks. It's like a
46+ dead man's switch for your cron jobs. You get alerted if they don't run on time
47+ or terminate with a failure.
48+ '';
49+ license = licenses.bsd0;
50+ maintainers = with maintainers; [ bdd ];
51+ };
52+}