2022-01-25 01:20:26 +00:00
|
|
|
{ lib, go, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2016-06-05 11:58:22 +00:00
|
|
|
|
2022-01-25 01:20:26 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "alertmanager";
|
2022-03-26 17:40:30 +00:00
|
|
|
version = "0.24.0";
|
2016-07-18 18:25:17 +00:00
|
|
|
rev = "v${version}";
|
2016-06-05 11:58:22 +00:00
|
|
|
|
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";
|
2022-03-26 17:40:30 +00:00
|
|
|
sha256 = "sha256-hoCE0wD9/Sh/oBce7kCg/wG44FmMs6dAKnEYP+2sH0w=";
|
2016-06-05 11:58:22 +00:00
|
|
|
};
|
|
|
|
|
2022-03-26 17:40:30 +00:00
|
|
|
vendorSha256 = "sha256-ePb9qdCTEHHIV6JlbrBlaZjD5APwQuoGloO88W5S7Oc=";
|
2022-01-25 01:20:26 +00:00
|
|
|
|
|
|
|
subPackages = [ "cmd/alertmanager" "cmd/amtool" ];
|
|
|
|
|
|
|
|
ldflags = let t = "github.com/prometheus/common/version"; in [
|
2021-08-26 03:31:57 +00:00
|
|
|
"-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 11:58:22 +00:00
|
|
|
|
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
|
2022-01-25 01:20:26 +00:00
|
|
|
$out/bin/amtool --completion-script-zsh > amtool.zsh
|
|
|
|
installShellCompletion amtool.zsh
|
2017-04-25 21:51:42 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-05 11:58:22 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|