2022-01-25 01:20:26 +00:00
|
|
|
{ lib, go, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2016-06-05 12:58:22 +01:00
|
|
|
|
2022-01-25 01:20:26 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "alertmanager";
|
2022-03-26 17:40:30 +00:00
|
|
|
version = "0.24.0";
|
2016-07-18 19:25:17 +01:00
|
|
|
rev = "v${version}";
|
2016-06-05 12:58:22 +01:00
|
|
|
|
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";
|
2022-03-26 17:40:30 +00:00
|
|
|
sha256 = "sha256-hoCE0wD9/Sh/oBce7kCg/wG44FmMs6dAKnEYP+2sH0w=";
|
2016-06-05 12:58:22 +01: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 04:31:57 +01: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 12:58:22 +01:00
|
|
|
|
2020-04-27 01:10:26 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2017-04-25 22:51:42 +01:00
|
|
|
postInstall = ''
|
2020-04-28 02:50:57 +01:00
|
|
|
$out/bin/amtool --completion-script-bash > amtool.bash
|
2020-04-27 01:10:26 +01: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 22:51:42 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-05 12:58:22 +01:00
|
|
|
description = "Alert dispatcher for the Prometheus monitoring system";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/prometheus/alertmanager";
|
2016-06-05 12:58:22 +01:00
|
|
|
license = licenses.asl20;
|
2020-06-17 19:38:00 +01:00
|
|
|
maintainers = with maintainers; [ benley fpletz globin Frostman ];
|
2016-06-05 12:58:22 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|