2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2019-12-18 20:10:15 +00:00
|
|
|
|
2021-01-23 06:54:58 +00:00
|
|
|
buildGoModule rec {
|
2019-12-18 20:10:15 +00:00
|
|
|
pname = "alertmanager-bot";
|
2021-01-23 06:54:58 +00:00
|
|
|
version = "0.4.3";
|
2019-12-18 20:10:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "metalmatze";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-01-23 06:54:58 +00:00
|
|
|
sha256 = "1hjfkksqb675gabzjc221b33h2m4s6qsanmkm382d3fyzqj71dh9";
|
2019-12-18 20:10:15 +00:00
|
|
|
};
|
|
|
|
|
2022-10-24 23:31:29 +00:00
|
|
|
vendorSha256 = null; #vendorSha256 = "";
|
2021-01-23 06:54:58 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed "s;/templates/default.tmpl;$out/share&;" -i cmd/alertmanager-bot/main.go
|
|
|
|
'';
|
|
|
|
|
2021-08-20 07:12:14 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X main.Version=v${version}" "-X main.Revision=${src.rev}"
|
|
|
|
];
|
2021-04-21 12:56:48 +00:00
|
|
|
|
2021-01-23 06:54:58 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 -t $out/share/templates $src/default.tmpl
|
|
|
|
'';
|
2019-12-18 20:10:15 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-12-18 20:10:15 +00:00
|
|
|
description = "Bot for Prometheus' Alertmanager";
|
|
|
|
homepage = "https://github.com/metalmatze/alertmanager-bot";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mmahut ];
|
2023-07-11 18:16:30 +00:00
|
|
|
broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check
|
2019-12-18 20:10:15 +00:00
|
|
|
};
|
|
|
|
}
|