nixpkgs-suyu/pkgs/servers/monitoring/sensu-go/default.nix

69 lines
1.8 KiB
Nix
Raw Normal View History

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