2021-02-05 17:12:51 +00:00
|
|
|
{ lib, go, buildGoPackage, fetchFromGitHub, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
|
|
|
pname = "alertmanager";
|
2020-06-18 07:06:33 +00:00
|
|
|
version = "0.21.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
|
|
|
|
goPackagePath = "github.com/prometheus/alertmanager";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit rev;
|
|
|
|
owner = "prometheus";
|
|
|
|
repo = "alertmanager";
|
2020-06-18 07:06:33 +00:00
|
|
|
sha256 = "0zrzyaqs73pz4rmj4xaj15x4n1542m0nb7jqm2j77k07j75r5w41";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildFlagsArray = let t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; in ''
|
|
|
|
-ldflags=
|
|
|
|
-X ${t}.Version=${version}
|
|
|
|
-X ${t}.Revision=${src.rev}
|
|
|
|
-X ${t}.Branch=unknown
|
|
|
|
-X ${t}.BuildUser=nix@nixpkgs
|
|
|
|
-X ${t}.BuildDate=unknown
|
2021-01-15 22:18:51 +00:00
|
|
|
-X ${t}.GoVersion=${lib.getVersion go}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
$out/bin/amtool --completion-script-bash > amtool.bash
|
2020-05-03 17:38:23 +00:00
|
|
|
installShellCompletion amtool.bash
|
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 = "Alert dispatcher for the Prometheus monitoring system";
|
|
|
|
homepage = "https://github.com/prometheus/alertmanager";
|
|
|
|
license = licenses.asl20;
|
2020-06-18 07:06:33 +00:00
|
|
|
maintainers = with maintainers; [ benley fpletz globin Frostman ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|