2022-02-10 20:34:41 +00:00
|
|
|
{ lib, go, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "alertmanager";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.23.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit rev;
|
|
|
|
owner = "prometheus";
|
|
|
|
repo = "alertmanager";
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "sha256-06mKgWUyw5jsjKiRXQ9/oqHvFdkY2nS9Z3eW60lTNbU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
vendorSha256 = "sha256-zJvzCC7Vn5repWssyDuGtoUSZC2ojQhMqDX5Orr0ST0=";
|
|
|
|
|
|
|
|
subPackages = [ "cmd/alertmanager" "cmd/amtool" ];
|
|
|
|
|
|
|
|
ldflags = let t = "github.com/prometheus/common/version"; in [
|
2021-08-27 14:25:00 +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}"
|
|
|
|
];
|
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
|
2022-02-10 20:34:41 +00:00
|
|
|
$out/bin/amtool --completion-script-zsh > amtool.zsh
|
|
|
|
installShellCompletion amtool.zsh
|
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;
|
|
|
|
};
|
|
|
|
}
|