anchor.diff:        "-X ${package_url}.gitTreeState=clean"
       ];
   
  -  # Test is disabled because ksonnet is missing from nixpkgs.
  -  # Log: https://gist.github.com/superherointj/79cbdc869dfd44d28a10dc6746ecb3f9
  -  doCheck = false;
  -  checkInputs = [
  -    helm
  -    kustomize
  -    #ksonnet
  -  ];
  -
  -  doInstallCheck = true;
  -  installCheckPhase = ''
  -    $out/bin/argocd version --client | grep ${tag} > /dev/null
  -    $out/bin/argocd-util version --client | grep ${tag} > /dev/null
  -  '';
  +  nativeBuildInputs = [ installShellFiles ];
   
     installPhase = ''
       runHook preInstall
  
positive.code:     runHook postInstall
    '';
  
    postInstall = ''
      for appname in argocd-util argocd-server argocd-repo-server argocd-application-controller argocd-dex ; do
        makeWrapper $out/bin/argocd $out/bin/$appname --set ARGOCD_BINARY_NAME $appname
      done
      installShellCompletion --cmd argocd \
        --bash <($out/bin/argocd completion bash) \
        --zsh <($out/bin/argocd completion zsh)
  
negative.code: { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
  
  buildGoModule rec {
    pname = "argocd";
    version = "2.3.1";
    tag = "v${version}";
    # Update commit to match the tag above
    # TODO make updadeScript
    commit = "b65c1699fa2a2daa031483a3890e6911eac69068";
  
    src = fetchFromGitHub {
      owner = "argoproj";
      repo = "argo-cd";
      rev = tag;
      sha256 = "sha256-YijhJz7m5wy8kR9V6IHSNYjiWh7H2ph6il9nMsrePOE=";
    };
  
    vendorSha256 = "sha256-uA9sOMuVHKRRhSGoLyoKcUYU6NxtprVUITvVC+tot1g=";
  
    # Set target as ./cmd per release-cli
    # https://github.com/argoproj/argo-cd/blob/master/Makefile#L222
    subPackages = [ "cmd" ];
  
    ldflags =
      let package_url = "github.com/argoproj/argo-cd/v2/common"; in
  