Skip to content

Commit

Permalink
datadog-integrations-core: moderinize derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRTitor committed Dec 7, 2024
1 parent bbcd0f3 commit b6788a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 8 additions & 8 deletions pkgs/tools/networking/dd-agent/integrations-core.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
#
# [1]: https://github.com/DataDog/integrations-core

{ pkgs, python, extraIntegrations ? { }, }:
{ lib, fetchFromGitHub, python3Packages, extraIntegrations ? { }, }:

let
inherit (pkgs.lib) attrValues mapAttrs;
inherit (lib) attrValues mapAttrs;

src = pkgs.fetchFromGitHub {
src = fetchFromGitHub {
owner = "DataDog";
repo = "integrations-core";
rev = version;
Expand All @@ -48,13 +48,13 @@ let

# Build helper to build a single datadog integration package.
buildIntegration = { pname, ... }@args:
python.pkgs.buildPythonPackage (args // {
python3Packages.buildPythonPackage (args // {
inherit src version;
name = "datadog-integration-${pname}-${version}";
pyproject = true;

sourceRoot = "${src.name}/${args.sourceRoot or pname}";
buildInputs = with python.pkgs; [ hatchling setuptools ];
buildInputs = with python3Packages; [ hatchling setuptools ];
doCheck = false;
});

Expand All @@ -70,7 +70,7 @@ let
--replace "packages=['datadog_checks']" "packages=find_packages()"
'';

propagatedBuildInputs = with python.pkgs; [
propagatedBuildInputs = with python3Packages; [
binary
cachetools
cryptography
Expand Down Expand Up @@ -110,10 +110,10 @@ let
integrations = defaultIntegrations // extraIntegrations;
builtIntegrations = mapAttrs (pname: fdeps: buildIntegration {
inherit pname;
propagatedBuildInputs = (fdeps python.pkgs) ++ [ datadog_checks_base ];
propagatedBuildInputs = (fdeps python3Packages) ++ [ datadog_checks_base ];
}) integrations;

in builtIntegrations // {
inherit datadog_checks_base;
python = python.withPackages (_: (attrValues builtIntegrations));
python = python3Packages.python.withPackages (_: (attrValues builtIntegrations));
}
1 change: 0 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13544,7 +13544,6 @@ with pkgs;
};
datadog-process-agent = callPackage ../tools/networking/dd-agent/datadog-process-agent.nix { };
datadog-integrations-core = extras: callPackage ../tools/networking/dd-agent/integrations-core.nix {
python = python3;
extraIntegrations = extras;
};

Expand Down

0 comments on commit b6788a4

Please sign in to comment.