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

61 lines
1.7 KiB
Nix
Raw Normal View History

2019-06-09 14:29:49 +01:00
{ buildGoPackage, fetchFromGitHub, lib }:
let
generic = { subPackages, pname, postInstall ? "" }:
buildGoPackage rec {
inherit pname;
2019-06-20 03:17:50 +01:00
version = "5.10.0";
shortRev = "c7551ba"; # for internal version info
2019-06-09 14:29:49 +01:00
goPackagePath = "github.com/sensu/sensu-go";
src = fetchFromGitHub {
owner = "sensu";
repo = "sensu-go";
rev = version;
2019-06-20 03:17:50 +01:00
sha256 = "1hma54mdh150d51rwz5csqbn0h24qk6hydjmib68j7zd7kp92yb5";
2019-06-09 14:29:49 +01:00
};
inherit subPackages postInstall;
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
''${!outputBin}/bin/sensuctl completion zsh > ''${!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" ];
};
}