Unverified Commit 9b226c9b authored by zowoq's avatar zowoq Committed by GitHub
Browse files

gh: opt out of telemetry collection by default (#515047)

parents 6d707dd8 ec7f8fa4
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -5,7 +5,8 @@
  installShellFiles,
  stdenv,
  testers,
  gh,
  makeWrapper,
  enableTelemetry ? false,
}:

buildGoModule (finalAttrs: {
@@ -21,7 +22,10 @@ buildGoModule (finalAttrs: {

  vendorHash = "sha256-4xZAcwn9/vUTkahIlqwyGb/2SYYGusdXY4nye8ldp/g=";

  nativeBuildInputs = [ installShellFiles ];
  nativeBuildInputs = [
    installShellFiles
    makeWrapper
  ];

  # N.B.: using the Makefile is intentional.
  # We pass "nixpkgs" for build.Date to avoid `gh --version` reporting a very old date.
@@ -35,6 +39,10 @@ buildGoModule (finalAttrs: {
    runHook preInstall
    install -Dm755 bin/gh -t $out/bin
  ''
  + lib.optionalString (!enableTelemetry) ''
    wrapProgram $out/bin/gh \
      --set GH_TELEMETRY false
  ''
  + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installManPage share/man/*/*.[1-9]

@@ -51,7 +59,7 @@ buildGoModule (finalAttrs: {
  doCheck = false;

  passthru.tests.version = testers.testVersion {
    package = gh;
    package = finalAttrs.finalPackage;
  };

  meta = {