diff options
author | hacker1024 <hacker1024@users.sourceforge.net> | 2024-01-10 20:29:53 +1100 |
---|---|---|
committer | hacker1024 <hacker1024@users.sourceforge.net> | 2024-01-10 20:29:53 +1100 |
commit | 778cefd4646ad54b028ec621fa7d2a60b61fef07 (patch) | |
tree | 9a6df6b0004a9466f4eac6076b60f387b1297a6d /doc | |
parent | cf53751a16df6ae52eb3be7019aa9c34017e490b (diff) | |
download | nixlib-778cefd4646ad54b028ec621fa7d2a60b61fef07.tar nixlib-778cefd4646ad54b028ec621fa7d2a60b61fef07.tar.gz nixlib-778cefd4646ad54b028ec621fa7d2a60b61fef07.tar.bz2 nixlib-778cefd4646ad54b028ec621fa7d2a60b61fef07.tar.lz nixlib-778cefd4646ad54b028ec621fa7d2a60b61fef07.tar.xz nixlib-778cefd4646ad54b028ec621fa7d2a60b61fef07.tar.zst nixlib-778cefd4646ad54b028ec621fa7d2a60b61fef07.zip |
buildDartApplication: Allow reading pubspec.lock with IFD
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/dart.section.md | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/doc/languages-frameworks/dart.section.md b/doc/languages-frameworks/dart.section.md index 9af02ef143b6..97817c5dcccc 100644 --- a/doc/languages-frameworks/dart.section.md +++ b/doc/languages-frameworks/dart.section.md @@ -11,6 +11,18 @@ If you are packaging a Flutter desktop application, use [`buildFlutterApplicatio `pubspecLock` is the parsed pubspec.lock file. pub2nix uses this to download required packages. This can be converted to JSON from YAML with something like `yq . pubspec.lock`, and then read by Nix. +Alternatively, `autoPubspecLock` can be used instead, and set to a path to a regular `pubspec.lock` file. This relies on import-from-derivation, and is not permitted in Nixpkgs, but can be useful at other times. + +::: {.warning} +When using `autoPubspecLock` with a local source directory, make sure to use a +concatenation operator (e.g. `autoPubspecLock = ${src} + "/pubspec.lock";`), and +not string interpolation. + +String interpolation will copy your entire source directory to the Nix store and +use its store path, meaning that unrelated changes to your source tree will +cause the generated `pubspec.lock` derivation to rebuild! +::: + If the package has Git package dependencies, the hashes must be provided in the `gitHashes` set. If a hash is missing, an error message prompting you to add it will be shown. The `dart` commands run can be overridden through `pubGetScript` and `dartCompileCommand`, you can also add flags using `dartCompileFlags` or `dartJitFlags`. @@ -101,8 +113,8 @@ flutter.buildFlutterApplication { pubspecLock = lib.importJSON ./pubspec.lock.json; } +``` ### Usage with nix-shell {#ssec-dart-flutter-nix-shell} -See the [Dart documentation](#ssec-dart-applications-nix-shell) nix-shell instructions. -``` +See the [Dart documentation](#ssec-dart-applications-nix-shell) for nix-shell instructions. |