2020-04-24 23:36:52 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib }:
|
|
|
|
|
|
|
|
let
|
|
|
|
generic = { subPackages, pname, postInstall ? "" }:
|
|
|
|
buildGoModule rec {
|
|
|
|
inherit pname;
|
2020-07-18 16:06:22 +00:00
|
|
|
version = "5.21.0";
|
2020-05-15 21:57:56 +00:00
|
|
|
shortRev = "3a1ac58"; # for internal version info
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
goPackagePath = "github.com/sensu/sensu-go";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sensu";
|
|
|
|
repo = "sensu-go";
|
|
|
|
rev = "v${version}";
|
2020-07-18 16:06:22 +00:00
|
|
|
sha256 = "0zkwhr2z8yy8k2lal026i565hxxh51jrgplq83bbisc24xpcfg9s";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit subPackages postInstall;
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
vendorSha256 = "06yfaj9k5n3jw8a142sscaqrvdw2lq51v884lp65wjdwy5c3jbba";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildFlagsArray = let
|
|
|
|
versionPkg = "github.com/sensu/sensu-go/version";
|
|
|
|
in ''
|
|
|
|
-ldflags=
|
|
|
|
-X ${versionPkg}.Version=${version}
|
|
|
|
-X ${versionPkg}.BuildSHA=${shortRev}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://sensu.io";
|
|
|
|
description = "Open source monitoring tool for ephemeral infrastructure & distributed applications";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ thefloweringash ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
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
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
sensu-go-backend = generic {
|
|
|
|
pname = "sensu-go-backend";
|
|
|
|
subPackages = [ "cmd/sensu-backend" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
sensu-go-agent = generic {
|
|
|
|
pname = "sensu-go-agent";
|
|
|
|
subPackages = [ "cmd/sensu-agent" ];
|
|
|
|
};
|
2020-05-15 21:57:56 +00:00
|
|
|
}
|