Open lucasew opened 7 months ago
Would be great if you also have other examples where this might be needed to find a good abstraction that can be re-used.
Does the normal nix build itself also need the pubspec.lock?
Would be great if you also have other examples where this might be needed to find a good abstraction that can be re-used.
Any case that would otherwise be a IFD to get a file from src is a exemple.
Does the normal nix build itself also need the pubspec.lock?
buildFlutterApplication
needs the pubspec.lock converted to JSON, having a API based on derivations instead of "copy this file there" would give more autonomy to the user without the risk of compromising the machine with unsandboxed noise such as cache files.
Ok. So what file does it produce after having the pubspec? I assume it generate some nix code?
Ok. So what file does it produce after having the pubspec? I assume it generate some nix code?
In the flutter case it consumes the pubspec.lock converted to JSON. Kind of Nix code with extra steps.
The problem:
Packages built with
buildFlutterApplication
need to vendor thepubspec.lock
as a JSON file to be used in the builder. The issue is that there is no simple way to setup this in a r-ryantm friendly way.What I suggest is something like a function that gets defined in passthru that receives the src and returns the stuff that should be copied in the Nix code folder.
Example:
That pubspec.lock will be copied to the location where the nix file defining the derivation is located in a
cp $src/* $out
fashion. It seems the primitives are already there but I need to study more the code to find out where should I put it and write a prototype.