From ae276351ab530f337b3b21eed6bf514b161e9ed3 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 16 Feb 2026 11:29:58 -0800 Subject: [PATCH] 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`. --- pkgs/misc/logging/beats/7.x.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/misc/logging/beats/7.x.nix b/pkgs/misc/logging/beats/7.x.nix index dc214f05e617..dcfc51edb400 100644 --- a/pkgs/misc/logging/beats/7.x.nix +++ b/pkgs/misc/logging/beats/7.x.nix @@ -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