Change:
Expected output: empty gohai can be found here: This holds for nixpkgs master.
I've submitted to fix this issue. We've worked around it until this is released by adding the derivation to our NixOS configuration repository and adding it to the unit's path, like so: NixOS will merge that option together with the already existing derivations on the unit's path, so it doesn't break the existing configuration. We've been running this change on a dozen or so live-servers and it works fine.
pull request was merged.
The fix is now in 18.03 :)

Discussion:
instances: - use_mount: no ''; networkConfig = pkgs.writeText "network.yaml" '' init_config:

- lo - lo0 ''; postgresqlConfig = pkgs.writeText "postgres.yaml" cfg.postgresqlConfig; nginxConfig = pkgs.writeText "nginx.yaml" cfg.nginxConfig; mongoConfig = pkgs.writeText "mongo.yaml" cfg.mongoConfig; jmxConfig = pkgs.writeText "jmx.yaml" cfg.jmxConfig; processConfig = pkgs.writeText "process.yaml" cfg.processConfig; etcfiles = let defaultConfd = import ./dd-agent-defaults.nix;

default = null; type = types.uniq (types.nullOr types.string); }; mongoConfig = mkOption { description = "MongoDB integration configuration"; default = null;

processConfig = mkOption { description = '' Process integration configuration See http://docs.datadoghq.com/integrations/process/ ''; default = null;

systemd.services.dd-agent = { description = "Datadog agent monitor"; <del> path = [ pkgs."dd-agent" pkgs.python pkgs.sysstat pkgs.procps ]; </del> <ins> path = [ pkgs."dd-agent" pkgs.python pkgs.sysstat pkgs.procps pkgs.gohai ]; </ins> wantedBy = [ "multi-user.target" ]; serviceConfig = { ExecStart = "${pkgs.dd-agent}/bin/dd-agent foreground";

<ins> { lib, stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: buildGoPackage rec { name = "gohai-${version}"; version = "2018-05-23"; rev = "60e13eaed98afa238ad6dfc98224c04fbb7b19b1"; goPackagePath = "github.com/DataDog/gohai"; src = fetchgit { inherit rev; url    = "https://github.com/DataDog/gohai"; sha256 = "15hdw195f6ayrmj1nbyfpfswdai1r1z3qjw927mbma7rwql24dkr"; }; goDeps = ./deps.nix; meta = with lib; { description      = "System information collector"; homepage         = "https://github.com/DataDog/gohai"; license          = licenses.mit; maintainers      = [ maintainers.tazjin ]; platforms        = platforms.unix; repositories.git = git://github.com/DataDog/gohai.git; longDescription = '' Gohai is a tool which collects an inventory of system information. It is used by the Datadog agent to provide detailed system metrics. ''; }; } </ins>

<ins> # This file was generated by https://github.com/kamilchm/go2nix v1.2.1 [ { goPackagePath = "github.com/cihub/seelog"; fetch = { type = "git"; url = "https://github.com/cihub/seelog"; rev = "f561c5e57575bb1e0a2167028b7339b3a8d16fb4"; sha256 = "0r3228hvgljgpaggj6b9mvxfsizfw25q2c1761wsvcif8gz49cvl"; }; } { goPackagePath = "github.com/shirou/gopsutil"; fetch = { type = "git"; url = "https://github.com/shirou/gopsutil"; rev = "eeb1d38d69593f121e060d24d17f7b1f0936b203"; sha256 = "01qsznk599225gf4pld7p2m30p61y77mvzhrs6raxpk6wf7icp4w"; }; } { goPackagePath = "golang.org/x/sys"; fetch = { type = "git"; url = "https://go.googlesource.com/sys"; rev = "77b0e4315053a57ed2962443614bdb28db152054"; sha256 = "1024gcv1b40i2rgvpgyw2hgy1k5g7473pn29yavwysj37m1rrplp"; }; } ] </ins>

goa = callPackage ../development/tools/goa { }; <ins> gohai = callPackage ../tools/system/gohai { }; </ins> gorilla-bin = callPackage ../tools/security/gorilla-bin { }; gosu = callPackage ../tools/misc/gosu { };