turbo: Rewrite wrapper from runCommand to symlinkJoin

This commit is contained in:
Sam A. Horvath-Hunt 2024-05-01 15:54:59 +01:00
parent 2c0219bb23
commit a640f69949
No known key found for this signature in database
GPG key ID: 4667250BD56735A8

View file

@ -1,9 +1,16 @@
{ lib, runCommand, makeWrapper, turbo-unwrapped
{ lib, symlinkJoin, 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"}
''
symlinkJoin {
pname = "turbo";
name = "turbo-${turbo-unwrapped.version}";
inherit (turbo-unwrapped) version meta;
nativeBuildInputs = [ makeWrapper ];
paths = [ turbo-unwrapped ];
postBuild = ''
rm $out/bin/turbo
makeWrapper ${turbo-unwrapped}/bin/turbo $out/bin/turbo \
${lib.optionalString disableTelemetry "--set TURBO_TELEMETRY_DISABLED 1"} \
${lib.optionalString disableUpdateNotifier "--add-flags --no-update-notifier"}
'';
}