2016-12-01 01:33:51 +01:00
|
|
|
{ stdenv, go, buildGoPackage, fetchFromGitHub }:
|
2016-06-05 13:58:22 +02:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
|
|
|
name = "alertmanager-${version}";
|
2019-04-10 14:52:31 +02:00
|
|
|
version = "0.16.2";
|
2016-07-18 20:25:17 +02:00
|
|
|
rev = "v${version}";
|
2016-06-05 13:58:22 +02:00
|
|
|
|
|
|
|
goPackagePath = "github.com/prometheus/alertmanager";
|
|
|
|
|
2016-06-06 10:05:20 +02:00
|
|
|
src = fetchFromGitHub {
|
2016-06-05 13:58:22 +02:00
|
|
|
inherit rev;
|
2016-06-06 10:05:20 +02:00
|
|
|
owner = "prometheus";
|
|
|
|
repo = "alertmanager";
|
2019-04-10 14:52:31 +02:00
|
|
|
sha256 = "0zjyr9964qxv5fsb17qhmxa1v4z0c7va60n05p9w6j2ah4dmcd8q";
|
2016-06-05 13:58:22 +02:00
|
|
|
};
|
|
|
|
|
2018-01-25 23:09:34 +01:00
|
|
|
buildFlagsArray = let t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; in ''
|
2016-06-05 13:58:22 +02:00
|
|
|
-ldflags=
|
|
|
|
-X ${t}.Version=${version}
|
2018-01-25 23:09:34 +01:00
|
|
|
-X ${t}.Revision=${src.rev}
|
2016-06-05 13:58:22 +02:00
|
|
|
-X ${t}.Branch=unknown
|
|
|
|
-X ${t}.BuildUser=nix@nixpkgs
|
|
|
|
-X ${t}.BuildDate=unknown
|
|
|
|
-X ${t}.GoVersion=${stdenv.lib.getVersion go}
|
|
|
|
'';
|
|
|
|
|
2017-04-25 23:51:42 +02:00
|
|
|
postInstall = ''
|
2018-01-25 23:09:34 +01:00
|
|
|
mkdir -p $bin/etc/bash_completion.d
|
|
|
|
$NIX_BUILD_TOP/go/bin/amtool --completion-script-bash > $bin/etc/bash_completion.d/amtool_completion.sh
|
2017-04-25 23:51:42 +02:00
|
|
|
'';
|
|
|
|
|
2016-06-05 13:58:22 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Alert dispatcher for the Prometheus monitoring system";
|
|
|
|
homepage = https://github.com/prometheus/alertmanager;
|
|
|
|
license = licenses.asl20;
|
2016-12-01 01:33:51 +01:00
|
|
|
maintainers = with maintainers; [ benley fpletz ];
|
2016-06-05 13:58:22 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|