···45This can be done in `preBuild`, in one of two ways:
46471. Packaging the tool with `buildDartApplication`, adding it to Nixpkgs, and running it like any other application
48-2. Running the tool from the Pub cache
4950Of these methods, the first is recommended when using a tool that does not need
51to be of a specific version.
5253-To use the second method, first make the derivation accessible within itself (e.g. `let self = ...; in self`), and then run it from the Pub cache in `preBuild`.
05455e.g., for `build_runner`:
5657```bash
58-dart --packages=.dart_tool/package_config.json ${self.pubspecLock.dependencySources.build_runner.packagePath}/bin/build_runner.dart build
59```
6061Do _not_ use `dart run <package_name>`, as this will attempt to download dependencies with Pub.
···45This can be done in `preBuild`, in one of two ways:
46471. Packaging the tool with `buildDartApplication`, adding it to Nixpkgs, and running it like any other application
48+2. Running the tool from the package cache
4950Of these methods, the first is recommended when using a tool that does not need
51to be of a specific version.
5253+For the second method, the `packageRun` function from the `dartConfigHook` can be used.
54+This is an alternative to `dart run` that does not rely on Pub.
5556e.g., for `build_runner`:
5758```bash
59+packageRun build_runner -- build
60```
6162Do _not_ use `dart run <package_name>`, as this will attempt to download dependencies with Pub.