2022-07-14 12:49:19 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, testers, runitor }:
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "runitor";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "1.0.0";
|
2022-04-27 09:35:20 +00:00
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bdd";
|
|
|
|
repo = "runitor";
|
|
|
|
rev = "v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-6+U6Mh1XMdGaAmOrqUlVBX9d/GfOgXE22GwcLl0EfIU=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X main.Version=v${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|