Skip to content

Commit

Permalink
Add comment and only include library if there is one.
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Oct 8, 2024
1 parent 72dcba6 commit 0ec25e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/load-cabal-plan.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ let
name = pkgs.lib.removePrefix "${prefix}:" n;
value = (if cabal2nixComponents == null then {} else cabal2nixComponents.${collectionName}.${name}) // {
buildable = true;
} // lookupDependencies hsPkgs (c.depends ++ pkgs.lib.optional (p ? components) p.id) c.exe-depends;
} // lookupDependencies hsPkgs (
c.depends
# If plan.json uses a single unit for this package (build-type: Custom),
# then it will leave the package itself out of `c.depends` for the
# components of the package.
# Haskell.nix builds the components separately so we need
# to add the `library` component as a dependency.
++ pkgs.lib.optional (p ? components && p.components ? lib) p.id
) c.exe-depends;
in { inherit name value; }
)) components));
in
Expand Down

0 comments on commit 0ec25e0

Please sign in to comment.