2016-12-01 00:33:51 +00:00
|
|
|
{ stdenv, go, buildGoPackage, fetchFromGitHub }:
|
2016-06-05 12:58:22 +01:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "alertmanager";
|
2019-10-03 20:00:39 +01:00
|
|
|
version = "0.19.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";
|
2019-10-03 20:00:39 +01:00
|
|
|
sha256 = "08k898x9ks5rzcmb7ps1rnxv36ynv64x8yq2ahpwmfkmv6nw1ylh";
|
2016-06-05 12:58:22 +01:00
|
|
|
};
|
|
|
|
|
2018-01-25 22:09:34 +00:00
|
|
|
buildFlagsArray = let t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; in ''
|
2016-06-05 12:58:22 +01:00
|
|
|
-ldflags=
|
|
|
|
-X ${t}.Version=${version}
|
2018-01-25 22:09:34 +00:00
|
|
|
-X ${t}.Revision=${src.rev}
|
2016-06-05 12:58:22 +01:00
|
|
|
-X ${t}.Branch=unknown
|
|
|
|
-X ${t}.BuildUser=nix@nixpkgs
|
|
|
|
-X ${t}.BuildDate=unknown
|
|
|
|
-X ${t}.GoVersion=${stdenv.lib.getVersion go}
|
|
|
|
'';
|
|
|
|
|
2017-04-25 22:51:42 +01:00
|
|
|
postInstall = ''
|
2018-01-25 22:09:34 +00: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 22:51:42 +01:00
|
|
|
'';
|
|
|
|
|
2016-06-05 12:58:22 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Alert dispatcher for the Prometheus monitoring system";
|
|
|
|
homepage = https://github.com/prometheus/alertmanager;
|
|
|
|
license = licenses.asl20;
|
2019-08-20 18:36:05 +01:00
|
|
|
maintainers = with maintainers; [ benley fpletz globin ];
|
2016-06-05 12:58:22 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|