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