about summary refs log tree commit diff
path: root/pkgs/tools/system/runitor
diff options
context:
space:
mode:
authorBerk D. Demir <bdd@mindcast.org>2022-04-27 01:33:53 +0000
committerBerk D. Demir <bdd@mindcast.org>2022-04-30 20:51:16 +0000
commitc25b74970d2bb272e4616a65485f560602a788cc (patch)
tree393817de41b226f68c5097f9b28db2dc13db2bcb /pkgs/tools/system/runitor
parent78f6f779627c89823d8402aac658418ef188be1c (diff)
runitor: init at 0.9.2
Diffstat (limited to 'pkgs/tools/system/runitor')
-rw-r--r--pkgs/tools/system/runitor/default.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/tools/system/runitor/default.nix b/pkgs/tools/system/runitor/default.nix
new file mode 100644
index 0000000000000..5bb821afdaf1a
--- /dev/null
+++ b/pkgs/tools/system/runitor/default.nix
@@ -0,0 +1,52 @@
+{ lib, buildGoModule, fetchFromGitHub, testers, runitor }:
+
+buildGoModule rec {
+  pname = "runitor";
+  version = "0.9.2";
+  vendorSha256 = null;
+
+  src = fetchFromGitHub {
+    owner = "bdd";
+    repo = "runitor";
+    rev = "v${version}";
+    sha256 = "sha256-LuCxn4j0MlnJjSh3d18YNzNrtbqtMPxgkZttqKUGJd4";
+  };
+
+  ldflags = [
+    "-s" "-w" "-X main.Version=v${version}"
+  ];
+
+  # TODO(cole-h):
+  # End-to-end tests requiring localhost networking currently under
+  # OfBorg's Linux builders, while passing under Darwin.
+  #
+  # Ref: https://github.com/NixOS/nixpkgs/pull/170566#issuecomment-1114034891
+  #
+  # Temporarily disable tests.
+  doCheck = false;
+
+  passthru.tests.version = testers.testVersion {
+    package = runitor;
+    command = "runitor -version";
+    version = "v${version}";
+  };
+
+  # Unit tests require binding to local addresses for listening sockets.
+  __darwinAllowLocalNetworking = true;
+
+  meta = with lib; {
+    homepage = "https://bdd.fi/x/runitor";
+    description = "A command runner with healthchecks.io integration";
+    longDescription = ''
+      Runitor runs the supplied command, captures its output, and based on its exit
+      code reports successful or failed execution to https://healthchecks.io or your
+      private instance.
+
+      Healthchecks.io is a web service for monitoring periodic tasks. It's like a
+      dead man's switch for your cron jobs. You get alerted if they don't run on time
+      or terminate with a failure.
+    '';
+    license = licenses.bsd0;
+    maintainers = with maintainers; [ bdd ];
+  };
+}