about summary refs log tree commit diff
path: root/nixpkgs/doc/languages-frameworks/dart.section.md
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-01-20 12:31:50 +0100
committerAlyssa Ross <hi@alyssa.is>2024-01-20 12:32:25 +0100
commitb7baf40e099b4215181fe7b0c63083b12ef2c7fb (patch)
treea6efabd31d05b6d0a36624729e80377bbbfb0149 /nixpkgs/doc/languages-frameworks/dart.section.md
parent710028664e26e85cb831a869b3da9f6993902255 (diff)
parent0799f514b1cd74878174939df79ac60ca5036673 (diff)
downloadnixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.gz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.bz2
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.lz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.xz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.zst
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/doc/languages-frameworks/dart.section.md')
-rw-r--r--nixpkgs/doc/languages-frameworks/dart.section.md16
1 files changed, 14 insertions, 2 deletions
diff --git a/nixpkgs/doc/languages-frameworks/dart.section.md b/nixpkgs/doc/languages-frameworks/dart.section.md
index 9af02ef143b6..fca87fa70e4e 100644
--- a/nixpkgs/doc/languages-frameworks/dart.section.md
+++ b/nixpkgs/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.