push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,138 @@
{
lib,
stdenv,
cmake,
buildGoModule,
makeWrapper,
fetchFromGitHub,
pythonPackages,
pkg-config,
systemd,
hostname,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
withDocker ? true,
extraTags ? [ ],
testers,
datadog-agent,
}:
let
# keep this in sync with github.com/DataDog/agent-payload dependency
payloadVersion = "5.0.164";
python = pythonPackages.python;
owner = "DataDog";
repo = "datadog-agent";
goPackagePath = "github.com/${owner}/${repo}";
version = "7.70.2";
src = fetchFromGitHub {
inherit owner repo;
tag = version;
hash = "sha256-yXtybHWrm+6kWW396FLlRZI0YVuThGuLfSYzoNXAEBU=";
};
rtloader = stdenv.mkDerivation {
pname = "datadog-agent-rtloader";
src = "${src}/rtloader";
inherit version;
nativeBuildInputs = [ cmake ];
buildInputs = [ python ];
cmakeFlags = [
"-DBUILD_DEMO=OFF"
"-DDISABLE_PYTHON2=ON"
];
};
in
buildGoModule rec {
pname = "datadog-agent";
inherit src version;
doCheck = false;
vendorHash = "sha256-iWOwhfSI7mLmDy6yewV0h9Y4pjYAV6Tz6TxsINOxYMg=";
subPackages = [
"cmd/agent"
"cmd/cluster-agent"
"cmd/dogstatsd"
"cmd/trace-agent"
];
nativeBuildInputs = [
pkg-config
makeWrapper
];
buildInputs = [ rtloader ] ++ lib.optionals withSystemd [ systemd ];
proxyVendor = true;
env.PKG_CONFIG_PATH = "${python}/lib/pkgconfig";
tags = [
"ec2"
"kubelet"
"python"
"process"
"log"
"secrets"
"zlib"
]
++ lib.optionals withSystemd [ "systemd" ]
++ lib.optionals withDocker [ "docker" ]
++ extraTags;
ldflags = [
"-X ${goPackagePath}/pkg/version.Commit=${src.rev}"
"-X ${goPackagePath}/pkg/version.AgentVersion=${version}"
"-X ${goPackagePath}/pkg/serializer.AgentPayloadVersion=${payloadVersion}"
"-X ${goPackagePath}/pkg/collector/python.pythonHome3=${python}"
"-X ${goPackagePath}/pkg/config/setup.DefaultPython=3"
"-r ${python}/lib"
];
# DataDog use paths relative to the agent binary, so fix these.
# We can't just point these to $out since that would introduce self-referential paths in the go modules,
# which are a fixed-output derivation. However, the patches aren't picked up if we skip them when building
# the modules. So we'll just traverse from the bin back to the out folder.
postPatch = ''
sed -e "s|PyChecksPath =.*|PyChecksPath = filepath.Join(_here, \"..\", \"${python.sitePackages}\")|" \
-e "s|distPath =.*|distPath = filepath.Join(_here, \"..\", \"share\", \"datadog-agent\")|" \
-i pkg/util/defaultpaths/path_nix.go
sed -e "s|/bin/hostname|${lib.getBin hostname}/bin/hostname|" \
-i pkg/util/hostname/fqdn_nix.go
'';
# Install the config files and python modules from the "dist" dir
# into standard paths.
postInstall = ''
mkdir -p $out/${python.sitePackages} $out/share/datadog-agent
cp -R --no-preserve=mode $src/cmd/agent/dist/conf.d $out/share/datadog-agent
rm -rf $out/share/datadog-agent/conf.d/{apm.yaml.default,process_agent.yaml.default,winproc.d,agentcrashdetect.d,myapp.d}
cp -R $src/cmd/agent/dist/{checks,utils,config.py} $out/${python.sitePackages}
wrapProgram "$out/bin/agent" \
--set PYTHONPATH "$out/${python.sitePackages}"''
+ lib.optionalString withSystemd " --prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
(lib.getLib systemd)
rtloader
]
}";
passthru.tests.version = testers.testVersion {
package = datadog-agent;
command = "agent version";
};
meta = with lib; {
description = ''
Event collector for the DataDog analysis service
-- v6 new golang implementation.
'';
homepage = "https://www.datadoghq.com";
license = licenses.bsd3;
maintainers = with maintainers; [
thoughtpolice
];
};
}

View File

@@ -0,0 +1,13 @@
{ lib, datadog-agent }:
datadog-agent.overrideAttrs (attrs: {
pname = "datadog-process-agent";
meta =
attrs.meta // {
description = "Live process collector for the DataDog Agent v7";
mainProgram = "process-agent";
maintainers = [ ];
};
subPackages = [ "cmd/process-agent" ];
postInstall = null;
})

View File

@@ -0,0 +1,136 @@
# The declarations in this file build the Datadog agent's core
# integrations. These integrations are tracked in a separate
# repository[1] outside of the agent's primary repository and provide
# checks for various kinds of services.
#
# Not all services are relevant for all users, however. As some of
# them depend on various tools and Python packages it is nonsensical
# to build *all* integrations by default.
#
# A set of default integrations is defined and built either way.
# Additional integrations can be specified by overriding
# `extraIntegrations` in datadog-integrations-core.
#
# In practice the syntax for using this with additional integrations
# is not the most beautiful, but it works. For example to use
# datadog-agent from the top-level with the `ntp`-integration
# included, one could say:
#
# let
# integrationsWithNtp = datadog-integrations-core {
# # Extra integrations map from the integration name (as in the
# # integrations-core repository) to a function that receives the
# # Python package set and returns the required dependencies.g
# ntp = (ps: [ ps.ntplib ]);
# };
#
# in ddAgentWithNtp = datadog-agent.overrideAttrs(_ : {
# python = integrationsWithNtp.python;
# });
#
# The NixOS module 'datadog-agent' provides a simplified interface to
# this. Please see the module itself for more information.
#
# [1]: https://github.com/DataDog/integrations-core
{
lib,
fetchFromGitHub,
python3Packages,
extraIntegrations ? { },
}:
let
inherit (lib) attrValues mapAttrs;
version = "7.70.2";
src = fetchFromGitHub {
owner = "DataDog";
repo = "integrations-core";
tag = version;
hash = "sha256-3H8nQpy/m53ZjtDfe6s89yowBXnPt+1ARfWxcx+JwQM=";
};
# Build helper to build a single datadog integration package.
buildIntegration =
{ pname, ... }@args:
python3Packages.buildPythonPackage (
args
// {
inherit src version;
name = "datadog-integration-${pname}-${version}";
pyproject = true;
sourceRoot = "${src.name}/${args.sourceRoot or pname}";
buildInputs = with python3Packages; [
hatchling
setuptools
];
doCheck = false;
}
);
# Base package depended on by all other integrations.
datadog_checks_base = buildIntegration {
pname = "checks-base";
sourceRoot = "datadog_checks_base";
dependencies = with python3Packages; [
binary
cachetools
cryptography
immutables
jellyfish
lazy-loader
prometheus-client
protobuf
pydantic
python-dateutil
pyyaml
requests
requests-toolbelt
requests-unixsocket
simplejson
uptime
wrapt
];
pythonImportsCheck = [
"datadog_checks.base"
"datadog_checks.base.checks"
"datadog_checks.checks"
];
};
# Default integrations that should be built:
defaultIntegrations = {
disk = (ps: [ ps.psutil ]);
mongo = (ps: [ ps.pymongo ]);
network = (ps: [ ps.psutil ]);
nginx = (ps: [ ]);
postgres = (
ps: with ps; [
pg8000
psycopg2
semver
]
);
process = (ps: [ ps.psutil ]);
};
# All integrations (default + extra):
integrations = defaultIntegrations // extraIntegrations;
builtIntegrations = mapAttrs (
pname: fdeps:
buildIntegration {
inherit pname;
propagatedBuildInputs = (fdeps python3Packages) ++ [ datadog_checks_base ];
}
) integrations;
in
builtIntegrations
// {
inherit datadog_checks_base;
python = python3Packages.python.withPackages (_: (attrValues builtIntegrations));
}