2021-02-05 17:12:51 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "alertmanager-bot";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "0.4.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "metalmatze";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "1hjfkksqb675gabzjc221b33h2m4s6qsanmkm382d3fyzqj71dh9";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
vendorSha256 = "1v0fgin8dn81b559zz4lqmrl7hikr46g4gb18sci4riql5qs1isj";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed "s;/templates/default.tmpl;$out/share&;" -i cmd/alertmanager-bot/main.go
|
|
|
|
'';
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X main.Version=v${version}" "-X main.Revision=${src.rev}"
|
|
|
|
];
|
2021-05-03 20:48:10 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 -t $out/share/templates $src/default.tmpl
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Bot for Prometheus' Alertmanager";
|
|
|
|
homepage = "https://github.com/metalmatze/alertmanager-bot";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mmahut ];
|
|
|
|
};
|
|
|
|
}
|