From 35d58c3421fea71394fa3b3e8c10bd862d76f3d8 Mon Sep 17 00:00:00 2001 From: Casey Ransom Date: Thu, 27 Jun 2019 13:52:16 -0400 Subject: [PATCH] datadog-agent: fix extraIntegrations The override that builds the custom python for integrations-core was overriding python, but pythonPackages was still being inherited from a call to `datadog-integrations-core {}`, causing service.datadog-agent.extraIntegrations to be ignored. --- nixos/modules/services/monitoring/datadog-agent.nix | 8 ++++---- pkgs/tools/networking/dd-agent/datadog-agent.nix | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/monitoring/datadog-agent.nix b/nixos/modules/services/monitoring/datadog-agent.nix index ce3d53fb2c17..7f78db74677c 100644 --- a/nixos/modules/services/monitoring/datadog-agent.nix +++ b/nixos/modules/services/monitoring/datadog-agent.nix @@ -42,9 +42,9 @@ let # Apply the configured extraIntegrations to the provided agent # package. See the documentation of `dd-agent/integrations-core.nix` # for detailed information on this. - datadogPkg = cfg.package.overrideAttrs(_: { - python = (pkgs.datadog-integrations-core cfg.extraIntegrations).python; - }); + datadogPkg = cfg.package.override { + pythonPackages = pkgs.datadog-integrations-core cfg.extraIntegrations; + }; in { options.services.datadog-agent = { enable = mkOption { @@ -60,7 +60,7 @@ in { defaultText = "pkgs.datadog-agent"; description = '' Which DataDog v6 agent package to use. Note that the provided - package is expected to have an overridable `python`-attribute + package is expected to have an overridable `pythonPackages`-attribute which configures the Python environment with the Datadog checks. ''; diff --git a/pkgs/tools/networking/dd-agent/datadog-agent.nix b/pkgs/tools/networking/dd-agent/datadog-agent.nix index fbf7efb69339..d2ae24c8a710 100644 --- a/pkgs/tools/networking/dd-agent/datadog-agent.nix +++ b/pkgs/tools/networking/dd-agent/datadog-agent.nix @@ -3,6 +3,7 @@ let # keep this in sync with github.com/DataDog/agent-payload dependency payloadVersion = "4.7.1"; + python = pythonPackages.python; in buildGoPackage rec { name = "datadog-agent-${version}"; @@ -26,8 +27,6 @@ in buildGoPackage rec { goDeps = ./datadog-agent-deps.nix; goPackagePath = "github.com/${owner}/${repo}"; - # Explicitly set this here to allow it to be overridden. - python = pythonPackages.python; nativeBuildInputs = [ pkgconfig makeWrapper ]; buildInputs = [ systemd ];