Skip to content

IFD-less evaluation of local packages #144

@srid

Description

@srid

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 default.nix is in sync with the .cabal file (useful in CI). (pre-commit-hooks-nix can do this).

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpackage-setShould haskell-flake allow creating package sets, decoupled from projects?questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions