3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/monitoring/sensu-go/default.nix

70 lines
1.9 KiB
Nix
Raw Normal View History

{ buildGoModule, fetchFromGitHub, lib }:
2019-06-09 14:29:49 +01:00
let
generic = { subPackages, pname, postInstall ? "" }:
2019-10-29 17:14:46 +00:00
buildGoModule rec {
2019-06-09 14:29:49 +01:00
inherit pname;
2020-11-12 02:40:28 +00:00
version = "6.1.2";
2020-05-13 22:49:36 +01:00
shortRev = "3a1ac58"; # for internal version info
2019-06-09 14:29:49 +01:00
src = fetchFromGitHub {
owner = "sensu";
repo = "sensu-go";
2019-10-29 17:14:46 +00:00
rev = "v${version}";
2020-11-12 02:40:28 +00:00
sha256 = "1g4vh4ay5m3sl00j8rn4db87kfdyxcmnaf0rxnv4ah2fbj5nrh2n";
2019-06-09 14:29:49 +01:00
};
inherit subPackages postInstall;
2020-11-12 02:40:28 +00:00
vendorSha256 = "12qi94k8fjx0kaq2x977yhan8ynd6j6cbqx1l60gqs2xgkm71k9r";
2019-10-29 17:14:46 +00:00
doCheck = false;
2019-06-09 14:29:49 +01:00
buildFlagsArray = let
versionPkg = "github.com/sensu/sensu-go/version";
in ''
-ldflags=
-X ${versionPkg}.Version=${version}
-X ${versionPkg}.BuildSHA=${shortRev}
'';
meta = {
2020-03-14 13:08:11 +00:00
homepage = "https://sensu.io";
2019-06-09 14:29:49 +01:00
description = "Open source monitoring tool for ephemeral infrastructure & distributed applications";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ thefloweringash ];
2019-06-09 14:29:49 +01:00
};
};
in
{
sensu-go-cli = generic {
pname = "sensu-go-cli";
subPackages = [ "cmd/sensuctl" ];
postInstall = ''
mkdir -p \
"''${!outputBin}/share/bash-completion/completions" \
"''${!outputBin}/share/zsh/site-functions"
''${!outputBin}/bin/sensuctl completion bash > ''${!outputBin}/share/bash-completion/completions/sensuctl
2019-07-11 14:50:58 +01:00
# https://github.com/sensu/sensu-go/issues/3132
(
echo "#compdef sensuctl"
''${!outputBin}/bin/sensuctl completion zsh
echo '_complete sensuctl 2>/dev/null'
) > ''${!outputBin}/share/zsh/site-functions/_sensuctl
2019-06-09 14:29:49 +01:00
'';
};
sensu-go-backend = generic {
pname = "sensu-go-backend";
subPackages = [ "cmd/sensu-backend" ];
};
sensu-go-agent = generic {
pname = "sensu-go-agent";
subPackages = [ "cmd/sensu-agent" ];
};
}