I would like to use the work-on script in reflex-platform to compile a project that has been managed using stack until now as explained here.
In the stack.yaml's package list I have a reference to a package located in a local path, something like:
packages:
- '.'
- ../<my_package>
When I run the script I get a strange nix error saying that an anonymous function has been called without a required argument (with the name of the local package).
error: anonymous function at /nix/store/sci0xi7jjwl9krpsp051iry1blz0jaw0-cabal2nix-for-unknown-package/default.nix:1:1 called without required argument ‘my_package’, at /nix/store/wgg4rzg3hyywfd7b0917qmj4617rza7k-nixpkgs-32833c010ecf868826aaa3b60d322bf697f37134-src/pkgs/development/haskell-modules/make-package-set.nix:69:27
How can I tell nix where to find it?
You can add
my_package
using the package overriding mechanism inhaskellPackages
, as described in the NixPkgs ManualThe
cabal.project
file, as used for this purpose, is roughly equivalent to a set of overrides added tohaskellPackages
. If you're switching entirely to Nix, you can delete thecabal.project
when you're done, because it will be obsolete. NixPkgs'haskellPackages
does not have a use for it. It only uses cabal-install to build single packages at a time.