* fix: don't rely on string context for package source
Before this commit, the type of a package source (haskell-source-type)
depended on string contexts in its `check` function. However, string
contexts do not work well to represent a path to a package source. For
instance, "hello ./subdirectory" would have a string context, but is
obviously not a valid path.
Furthermore, a `nix` bug (https://github.com/NixOS/nix/issues/8428)
related to string contexts triggers an issue where setting the project
root causes a type error with haskell-source-type (https://github.com/srid/haskell-flake/issues/169).
This commit replaces haskell-source-type with `with type; either path str`
and instances of `isPathUnderNixStore` with `lib.types.path.check` to
avoid using string contexts.
* Update CHANGELOG.md
---------
Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
**Completely new way to override Haskell packages**: removed `overrides` and `source-overrides`. Use `packages` to specify your source overrides; use `settings` to override individual packages in modular fashion (like NixOS modules). Additional changes include:
- Add `package.<name>.cabal.executables` referring to the executables in a package. This is auto-detected by parsing the Cabal file.
- Add `packages.<name>.local.*` to determine of a package is a local package or not.
- Add `projectFlakeName` option (useful in debug logging prefix)
- `flake.haskellFlakeProjectModules`: Dropped all defaults, except the `output` module, which now exports `packages` and `settings`. Added a `defaults.projectModules.output` option that allows the user to override this module, or directly access the generated module.
- Add `project.config.defaults.settings.default` defining sensible defaults for local packages.
- Add `project.config.defaults.enable` to turn off all default settings en masse.
Also, disable docs test due to https://github.com/hercules-ci/flake.parts-website/issues/332
Also,
Add a corresponding `outputs.apps` option, while the `outputs.localPackages` option is renamed to `outputs.packages` (it now contains package metadata, including packages and its executables).
Also
- expose flake outputs in `config.haskellProjects.foo.outputs`.
- split the module so the main implementation lives in separate file (easier to modify in future PRs)