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.
This commit is contained in:
Casey Ransom 2019-06-27 13:52:16 -04:00
parent b5478fd1a2
commit 35d58c3421
2 changed files with 5 additions and 6 deletions

View File

@ -42,9 +42,9 @@ let
# Apply the configured extraIntegrations to the provided agent # Apply the configured extraIntegrations to the provided agent
# package. See the documentation of `dd-agent/integrations-core.nix` # package. See the documentation of `dd-agent/integrations-core.nix`
# for detailed information on this. # for detailed information on this.
datadogPkg = cfg.package.overrideAttrs(_: { datadogPkg = cfg.package.override {
python = (pkgs.datadog-integrations-core cfg.extraIntegrations).python; pythonPackages = pkgs.datadog-integrations-core cfg.extraIntegrations;
}); };
in { in {
options.services.datadog-agent = { options.services.datadog-agent = {
enable = mkOption { enable = mkOption {
@ -60,7 +60,7 @@ in {
defaultText = "pkgs.datadog-agent"; defaultText = "pkgs.datadog-agent";
description = '' description = ''
Which DataDog v6 agent package to use. Note that the provided 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 which configures the Python environment with the Datadog
checks. checks.
''; '';

View File

@ -3,6 +3,7 @@
let let
# keep this in sync with github.com/DataDog/agent-payload dependency # keep this in sync with github.com/DataDog/agent-payload dependency
payloadVersion = "4.7.1"; payloadVersion = "4.7.1";
python = pythonPackages.python;
in buildGoPackage rec { in buildGoPackage rec {
name = "datadog-agent-${version}"; name = "datadog-agent-${version}";
@ -26,8 +27,6 @@ in buildGoPackage rec {
goDeps = ./datadog-agent-deps.nix; goDeps = ./datadog-agent-deps.nix;
goPackagePath = "github.com/${owner}/${repo}"; goPackagePath = "github.com/${owner}/${repo}";
# Explicitly set this here to allow it to be overridden.
python = pythonPackages.python;
nativeBuildInputs = [ pkgconfig makeWrapper ]; nativeBuildInputs = [ pkgconfig makeWrapper ];
buildInputs = [ systemd ]; buildInputs = [ systemd ];