nixpkgs/pkgs/by-name/tu/turbo/package.nix
seth ea48e15618
turbo: modernize
Functionally this:

- Reduces occurrences of https://github.com/NixOS/nixpkgs/issues/208242
- Improve meta-attributes
- Fixes the meta-attributes of the wrapper
- Uses the preferred binary wrapper
- Runs the version test against the wrapper to ensure flags & dlopen
  calls work
2024-08-10 02:41:00 -04:00

43 lines
843 B
Nix

{
lib,
symlinkJoin,
makeBinaryWrapper,
testers,
turbo,
turbo-unwrapped,
# https://turbo.build/repo/docs/telemetry
disableTelemetry ? true,
disableUpdateNotifier ? true,
}:
symlinkJoin rec {
pname = "turbo";
inherit (turbo-unwrapped) version;
name = "${pname}-${version}";
nativeBuildInputs = [ makeBinaryWrapper ];
paths = [ turbo-unwrapped ];
postBuild = ''
wrapProgram $out/bin/turbo \
${lib.optionalString disableTelemetry "--set TURBO_TELEMETRY_DISABLED 1"} \
${lib.optionalString disableUpdateNotifier "--set TURBO_NO_UPDATE_NOTIFIER 1"}
'';
passthru = {
tests.version = testers.testVersion { package = turbo; };
};
meta = {
inherit (turbo-unwrapped.meta)
description
homepage
changelog
license
mainProgram
maintainers
;
};
}