2021-01-25 08:26:54 +00:00
|
|
|
{ lib, go, buildGoPackage, fetchFromGitHub, installShellFiles }:
|
2016-06-05 12:58:22 +01:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "alertmanager";
|
2020-06-17 19:37:38 +01:00
|
|
|
version = "0.21.0";
|
2016-07-18 19:25:17 +01:00
|
|
|
rev = "v${version}";
|
2016-06-05 12:58:22 +01:00
|
|
|
|
|
|
|
goPackagePath = "github.com/prometheus/alertmanager";
|
|
|
|
|
2016-06-06 09:05:20 +01:00
|
|
|
src = fetchFromGitHub {
|
2016-06-05 12:58:22 +01:00
|
|
|
inherit rev;
|
2016-06-06 09:05:20 +01:00
|
|
|
owner = "prometheus";
|
|
|
|
repo = "alertmanager";
|
2020-06-17 19:37:38 +01:00
|
|
|
sha256 = "0zrzyaqs73pz4rmj4xaj15x4n1542m0nb7jqm2j77k07j75r5w41";
|
2016-06-05 12:58:22 +01:00
|
|
|
};
|
|
|
|
|
2021-08-26 04:31:57 +01:00
|
|
|
ldflags = let t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; in [
|
|
|
|
"-X ${t}.Version=${version}"
|
|
|
|
"-X ${t}.Revision=${src.rev}"
|
|
|
|
"-X ${t}.Branch=unknown"
|
|
|
|
"-X ${t}.BuildUser=nix@nixpkgs"
|
|
|
|
"-X ${t}.BuildDate=unknown"
|
|
|
|
"-X ${t}.GoVersion=${lib.getVersion go}"
|
|
|
|
];
|
2016-06-05 12:58:22 +01:00
|
|
|
|
2020-04-27 01:10:26 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2017-04-25 22:51:42 +01:00
|
|
|
postInstall = ''
|
2020-04-28 02:50:57 +01:00
|
|
|
$out/bin/amtool --completion-script-bash > amtool.bash
|
2020-04-27 01:10:26 +01:00
|
|
|
installShellCompletion amtool.bash
|
2017-04-25 22:51:42 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-05 12:58:22 +01:00
|
|
|
description = "Alert dispatcher for the Prometheus monitoring system";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/prometheus/alertmanager";
|
2016-06-05 12:58:22 +01:00
|
|
|
license = licenses.asl20;
|
2020-06-17 19:38:00 +01:00
|
|
|
maintainers = with maintainers; [ benley fpletz globin Frostman ];
|
2016-06-05 12:58:22 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|