mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
beats 7.x: refactor
Replace `recursiveUpdate` with `//` and explicit `meta`/`passthru` merging so that `builtins.unsafeGetAttrPos` can find `meta.description` at each call site, making the `pos = __curPos` workaround unnecessary. Also adopt the `finalAttrs` pattern and use `tag` instead of `rev` in `fetchFromGitHub`.
This commit is contained in:
@@ -13,14 +13,15 @@ let
|
||||
beat =
|
||||
package: extraArgs:
|
||||
buildGoModule (
|
||||
lib.attrsets.recursiveUpdate rec {
|
||||
finalAttrs:
|
||||
{
|
||||
pname = package;
|
||||
version = elk7Version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "elastic";
|
||||
repo = "beats";
|
||||
rev = "v${version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-TzcKB1hIHe1LNZ59GcvR527yvYqPKNXPIhpWH2vyMTY=";
|
||||
};
|
||||
|
||||
@@ -36,17 +37,19 @@ let
|
||||
dfithian
|
||||
];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
} extraArgs
|
||||
}
|
||||
// (extraArgs.meta or { });
|
||||
}
|
||||
// removeAttrs extraArgs [
|
||||
"meta"
|
||||
]
|
||||
);
|
||||
in
|
||||
rec {
|
||||
auditbeat7 = beat "auditbeat" {
|
||||
pos = __curPos;
|
||||
meta.description = "Lightweight shipper for audit data";
|
||||
};
|
||||
filebeat7 = beat "filebeat" {
|
||||
pos = __curPos;
|
||||
meta.description = "Lightweight shipper for logfiles";
|
||||
buildInputs = [ systemd ];
|
||||
tags = [ "withjournald" ];
|
||||
@@ -55,11 +58,9 @@ rec {
|
||||
'';
|
||||
};
|
||||
heartbeat7 = beat "heartbeat" {
|
||||
pos = __curPos;
|
||||
meta.description = "Lightweight shipper for uptime monitoring";
|
||||
};
|
||||
metricbeat7 = beat "metricbeat" {
|
||||
pos = __curPos;
|
||||
meta.description = "Lightweight shipper for metrics";
|
||||
passthru.tests = lib.optionalAttrs config.allowUnfree (
|
||||
assert metricbeat7.drvPath == nixosTests.elk.unfree.ELK-7.elkPackages.metricbeat.drvPath;
|
||||
@@ -70,7 +71,6 @@ rec {
|
||||
};
|
||||
packetbeat7 = beat "packetbeat" {
|
||||
buildInputs = [ libpcap ];
|
||||
pos = __curPos;
|
||||
meta.description = "Network packet analyzer that ships data to Elasticsearch";
|
||||
meta.longDescription = ''
|
||||
Packetbeat is an open source network packet analyzer that ships the
|
||||
|
||||
Reference in New Issue
Block a user