IFD-less evaluation of local packages
@srid is already working on this.
Since Dec 13, 2023.
- Dominant language
- Nix
- Stars
- 240
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
IFD can really slow down the evaluation of the flake, such as to make the launching of nix develop noticeably slow -- this is currently the case for https://github.com/nammayatri/nammayatri which has gazillion local packages with lots of dependencies.
The idea here is to do something similar to the hpack -> cabal workflow, but for cabal -> nix. ie., use cabal2nix to generate a default.nix in the local package directory (example), for which we provide a nix run'able flake app that the developer will run anytime changing the .cabal file. There will also be a flake check (analogous to #97) to make sure that generated (pre-commit-hooks-nix can do this).default.nix is in sync with the .cabal file (useful in CI).
We could actually rename the default.nix to something unique to haskell-flake: haskell-package.nix.
Then, the following configuration:
{
haskellProjects.default = {
packages = {
foo.source = ./foo;
};
}
... would look for haskell-packages.nix and use that; if not, it looks for the .cabal file falling back to using IFD (callCabal2nix).
cc @roberth @locallycompact @NorfairKing for feedback/suggestions/ideas.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.