2020-04-24 23:36:52 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib }:
|
|
|
|
|
|
|
|
let
|
2021-10-28 06:52:43 +00:00
|
|
|
generic = { subPackages, pname, postInstall ? "", mainProgram }:
|
2020-04-24 23:36:52 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
inherit pname;
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "6.9.2";
|
2020-05-15 21:57:56 +00:00
|
|
|
shortRev = "3a1ac58"; # for internal version info
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sensu";
|
|
|
|
repo = "sensu-go";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-Xd15fkoSmQXbkyEMsBvc8ewLvn+wlsZoclfDjarp1FQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit subPackages postInstall;
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
vendorHash = "sha256-zrwTdMlDfG1RudOfV52qOP9NMU3/XYb5TND6xyglJ0I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
doCheck = false;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = let
|
2020-04-24 23:36:52 +00:00
|
|
|
versionPkg = "github.com/sensu/sensu-go/version";
|
2021-08-27 14:25:00 +00:00
|
|
|
in [
|
|
|
|
"-X ${versionPkg}.Version=${version}"
|
|
|
|
"-X ${versionPkg}.BuildSHA=${shortRev}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
2021-10-28 06:52:43 +00:00
|
|
|
inherit mainProgram;
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
'';
|
2021-10-28 06:52:43 +00:00
|
|
|
mainProgram = "sensuctl";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sensu-go-backend = generic {
|
|
|
|
pname = "sensu-go-backend";
|
|
|
|
subPackages = [ "cmd/sensu-backend" ];
|
2021-10-28 06:52:43 +00:00
|
|
|
mainProgram = "sensu-backend";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sensu-go-agent = generic {
|
|
|
|
pname = "sensu-go-agent";
|
|
|
|
subPackages = [ "cmd/sensu-agent" ];
|
2021-10-28 06:52:43 +00:00
|
|
|
mainProgram = "sensu-agent";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|