-
Notifications
You must be signed in to change notification settings - Fork 26
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.