From 07418742dcc90228f796f7daeacb9a7ae07199bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 2 Apr 2026 19:53:05 +0200 Subject: [PATCH] nixos/collectd: allow accessing the final package with applied plugins and minimalPackage This allows accessing share/collectd/types.db from the final package required to add custom types. --- nixos/modules/services/monitoring/collectd.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nixos/modules/services/monitoring/collectd.nix b/nixos/modules/services/monitoring/collectd.nix index fc97d4f63e6c..a80f7dfafaa8 100644 --- a/nixos/modules/services/monitoring/collectd.nix +++ b/nixos/modules/services/monitoring/collectd.nix @@ -46,6 +46,20 @@ in package = lib.mkPackageOption pkgs "collectd" { }; + finalPackage = lib.mkOption { + readOnly = true; + default = minimalPackage; + defaultText = lib.literalExpression '' + if config.services.collectd.buildMinimalPackage then + cfg.package.override { + enabledPlugins = [ "syslog" ] ++ builtins.attrNames cfg.plugins; + } + else + cfg.package + ''; + description = "The final package being used after applying plugins and minimalPackage."; + }; + buildMinimalPackage = lib.mkOption { default = false; description = ''