10 pname = "alertmanager";
14 src = fetchFromGitHub {
17 repo = "alertmanager";
18 hash = "sha256-soE2D/PLesV1+Kif9myB54a9zIFIa94i0BrmywJPTbI=";
21 vendorHash = "sha256-zkHIdEdAy44iV2F929NB3ISuUbxdecaeZcsNQQGd06E=";
23 subPackages = [ "cmd/alertmanager" "cmd/amtool" ];
25 ldflags = let t = "github.com/prometheus/common/version"; in [
26 "-X ${t}.Version=${version}"
27 "-X ${t}.Revision=${src.rev}"
28 "-X ${t}.Branch=unknown"
29 "-X ${t}.BuildUser=nix@nixpkgs"
30 "-X ${t}.BuildDate=unknown"
31 "-X ${t}.GoVersion=${lib.getVersion go}"
34 nativeBuildInputs = [ installShellFiles ];
37 $out/bin/amtool --completion-script-bash > amtool.bash
38 installShellCompletion amtool.bash
39 $out/bin/amtool --completion-script-zsh > amtool.zsh
40 installShellCompletion amtool.zsh
43 passthru.tests = { inherit (nixosTests.prometheus) alertmanager; };
46 description = "Alert dispatcher for the Prometheus monitoring system";
47 homepage = "https://github.com/prometheus/alertmanager";
48 changelog = "https://github.com/prometheus/alertmanager/blob/v${version}/CHANGELOG.md";
49 license = licenses.asl20;
50 maintainers = with maintainers; [ benley fpletz globin Frostman ];