anchor.diff:  
       systemd.services.dd-agent = {
         description = "Datadog agent monitor";
  -      path = [ pkgs."dd-agent" ];
  +      path = [ pkgs."dd-agent" pkgs.python pkgs.sysstat pkgs.procps];
         wantedBy = [ "multi-user.target" ];
         serviceConfig = {
           ExecStart = "${pkgs.dd-agent}/bin/dd-agent foreground";
           User = "dd-agent";
           Group = "dd-agent";
         };
  -      restartTriggers = [ pkgs.dd-agent ];
  +      restartTriggers = [ pkgs.dd-agent datadog_conf ];
  +    };
  +
  +    systemd.services.dogstatsd = {
  +      description = "Datadog statsd";
  +      path = [ pkgs."dd-agent" pkgs.python ];
  +      wantedBy = [ "multi-user.target" ];
  +      serviceConfig = {
  +        ExecStart = "${pkgs.dd-agent}/bin/dogstatsd start";
  +        User = "dd-agent";
  +        Group = "dd-agent";
  +        Type = "forking";
  +        PIDFile = "/tmp/dogstatsd.pid";
  +      };
  +      restartTriggers = [ pkgs.dd-agent datadog_conf ];
       };
     };
   }
  
positive.code:   };
  
    config = mkIf cfg.enable {
      environment.etc = [ { source = datadog-conf; target = "dd-agent/datadog.conf"; } ];
      environment.systemPackages = [ pkgs."dd-agent" ];
  
      users.extraUsers."dd-agent" = {
        description = "Datadog Agent User";
  
negative.code: let
    cfg = config.services.dd-agent;
  
    datadog_conf = pkgs.runCommand "datadog.conf" {} ''
      sed -e 's|^api_key:|api_key: ${cfg.api_key}|' ${optionalString (cfg.hostname != null)
        "-e 's|^#hostname: mymachine.mydomain|hostname: ${cfg.hostname}|'"
      } ${pkgs.dd-agent}/etc/dd-agent/datadog.conf.example > $out
  