2020-03-27 07:33:21 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib }:
|
2019-06-09 13:29:49 +00:00
|
|
|
|
|
|
|
let
|
2021-10-21 12:55:33 +00:00
|
|
|
generic = { subPackages, pname, postInstall ? "", mainProgram }:
|
2019-10-29 17:14:46 +00:00
|
|
|
buildGoModule rec {
|
2019-06-09 13:29:49 +00:00
|
|
|
inherit pname;
|
2022-12-05 01:46:01 +00:00
|
|
|
version = "6.9.1";
|
2020-05-13 21:49:36 +00:00
|
|
|
shortRev = "3a1ac58"; # for internal version info
|
2019-06-09 13:29:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sensu";
|
|
|
|
repo = "sensu-go";
|
2019-10-29 17:14:46 +00:00
|
|
|
rev = "v${version}";
|
2022-12-05 01:46:01 +00:00
|
|
|
sha256 = "sha256-vw5A5Cg4envrDfLsdauSONgd6rPZSu5wPiPOoNIcS9w=";
|
2019-06-09 13:29:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit subPackages postInstall;
|
|
|
|
|
2022-11-02 14:51:55 +00:00
|
|
|
vendorSha256 = "sha256-zrwTdMlDfG1RudOfV52qOP9NMU3/XYb5TND6xyglJ0I=";
|
2019-10-29 17:14:46 +00:00
|
|
|
|
2021-10-21 12:55:33 +00:00
|
|
|
doCheck = false;
|
2020-08-04 00:26:27 +00:00
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = let
|
2019-06-09 13:29:49 +00:00
|
|
|
versionPkg = "github.com/sensu/sensu-go/version";
|
2021-08-26 06:45:51 +00:00
|
|
|
in [
|
|
|
|
"-X ${versionPkg}.Version=${version}"
|
|
|
|
"-X ${versionPkg}.BuildSHA=${shortRev}"
|
|
|
|
];
|
2019-06-09 13:29:49 +00:00
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
meta = {
|
2021-10-21 12:55:33 +00:00
|
|
|
inherit mainProgram;
|
2020-03-14 13:08:11 +00:00
|
|
|
homepage = "https://sensu.io";
|
2019-06-09 13:29:49 +00:00
|
|
|
description = "Open source monitoring tool for ephemeral infrastructure & distributed applications";
|
2020-03-27 07:33:21 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ thefloweringash ];
|
2019-06-09 13:29:49 +00: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 13:50:58 +00: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 13:29:49 +00:00
|
|
|
'';
|
2021-10-21 12:55:33 +00:00
|
|
|
mainProgram = "sensuctl";
|
2019-06-09 13:29:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sensu-go-backend = generic {
|
|
|
|
pname = "sensu-go-backend";
|
|
|
|
subPackages = [ "cmd/sensu-backend" ];
|
2021-10-21 12:55:33 +00:00
|
|
|
mainProgram = "sensu-backend";
|
2019-06-09 13:29:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sensu-go-agent = generic {
|
|
|
|
pname = "sensu-go-agent";
|
|
|
|
subPackages = [ "cmd/sensu-agent" ];
|
2021-10-21 12:55:33 +00:00
|
|
|
mainProgram = "sensu-agent";
|
2019-06-09 13:29:49 +00:00
|
|
|
};
|
2020-07-31 03:58:04 +00:00
|
|
|
}
|