anchor.diff:  
   
     nativeBuildInputs = [ pkg-config makeWrapper ];
  -  buildInputs = [ systemd ];
  +  buildInputs = lib.optionals withSystemd [ systemd ];
     PKG_CONFIG_PATH = "${python}/lib/pkgconfig";
   
  -  preBuild = let
  -    ldFlags = lib.concatStringsSep " " [
  -      "-X ${goPackagePath}/pkg/version.Commit=${src.rev}"
  -      "-X ${goPackagePath}/pkg/version.AgentVersion=${version}"
  -      "-X ${goPackagePath}/pkg/serializer.AgentPayloadVersion=${payloadVersion}"
  -      "-X ${goPackagePath}/pkg/collector/py.pythonHome=${python}"
  -      "-r ${python}/lib"
  -    ];
  -  in ''
  -    buildFlagsArray=( "-tags" "ec2 systemd cpython process log secrets ${lib.concatStringsSep " " extraTags}" "-ldflags" "${ldFlags}")
  +  tags = [
  +    "ec2"
  +    "cpython"
  +    "process"
  +    "log"
  +    "secrets"
  +  ]
  +  ++ lib.optionals withSystemd [ "systemd" ]
  +  ++ 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/py.pythonHome=${python}"
  +    "-r ${python}/lib"
  +  ];
  +
  +  preBuild = ''
       # Keep directories to generate in sync with tasks/go.py
       go generate ./pkg/status ./cmd/agent/gui
     '';
  
positive.code: { lib, buildGoModule, makeWrapper, fetchFromGitHub, pythonPackages, pkg-config, systemd, hostname, extraTags ? [] }:
  
  let
    # keep this in sync with github.com/DataDog/agent-payload dependency
  
negative.code:     '';
      homepage    = "https://www.datadoghq.com";
      license     = licenses.bsd3;
      maintainers = with maintainers; [ thoughtpolice domenkozar rvl viraptor ];
    };
  }
  