From 2c0219bb232c267fda35765954d0ca5df5fa3b08 Mon Sep 17 00:00:00 2001 From: "Sam A. Horvath-Hunt" Date: Wed, 1 May 2024 11:19:23 +0100 Subject: [PATCH] turbo: Add turbo-unwrapped / disable update checks & telemetry in turbo --- pkgs/tools/misc/turbo/default.nix | 2 +- pkgs/tools/misc/turbo/wrapper.nix | 9 +++++++++ pkgs/top-level/all-packages.nix | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 pkgs/tools/misc/turbo/wrapper.nix diff --git a/pkgs/tools/misc/turbo/default.nix b/pkgs/tools/misc/turbo/default.nix index 6a2f7e9b033a..ca499d635360 100644 --- a/pkgs/tools/misc/turbo/default.nix +++ b/pkgs/tools/misc/turbo/default.nix @@ -17,7 +17,7 @@ , capnproto }: rustPlatform.buildRustPackage rec{ - pname = "turbo"; + pname = "turbo-unwrapped"; version = "1.13.2"; src = fetchFromGitHub { owner = "vercel"; diff --git a/pkgs/tools/misc/turbo/wrapper.nix b/pkgs/tools/misc/turbo/wrapper.nix new file mode 100644 index 000000000000..1bb5e10f34b6 --- /dev/null +++ b/pkgs/tools/misc/turbo/wrapper.nix @@ -0,0 +1,9 @@ +{ lib, runCommand, makeWrapper, turbo-unwrapped +, disableTelemetry ? true, disableUpdateNotifier ? true }: + +runCommand "turbo" { nativeBuildInputs = [ makeWrapper ]; } '' + mkdir -p $out/bin + makeWrapper ${turbo-unwrapped}/bin/turbo $out/bin/turbo \ + ${lib.optionalString disableTelemetry "--set TURBO_TELEMETRY_DISABLED 1"} \ + ${lib.optionalString disableUpdateNotifier "--add-flags --no-update-notifier"} +'' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0381bfd5d00a..f0d860ab14dd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14033,7 +14033,9 @@ with pkgs; tuptime = callPackage ../tools/system/tuptime { }; - turbo = callPackage ../tools/misc/turbo { + turbo = callPackage ../tools/misc/turbo/wrapper.nix { }; + + turbo-unwrapped = callPackage ../tools/misc/turbo { inherit (darwin.apple_sdk_11_0.frameworks) IOKit CoreServices CoreFoundation; };