Skip to content

Commit 56859ea

Browse files
committed
Fix the workbench shell
Using `cabalWrapped` also requires us to mess with `haskell.nix`'s choices for what packages to prepare the shell for.
1 parent a0b0003 commit 56859ea

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: nix/workbench/shell.nix

+11
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ in project.shellFor {
7878

7979
inherit withHoogle;
8080

81+
# The workbench shell uses cabalWrapped, which removes the `source-repository-package` stanzas
82+
# from `cabal.project`. The idea is to use prebuilt ones provided by haskell.nix. However,
83+
# haskell.nix is clever enough to not include `source-repository-package`s in the shell
84+
# package db, because it knows that cabal will rebuild them. So you just end up with nothing!
85+
# We can work around this by overriding haskell.nix's selection of which packages the shell
86+
# is prepared for, so that it *doesn't* include the `source-repository-package` ones
87+
# (the default is *local* packages which includes them, we select *project* pacakges which doesn't)
88+
# Note that this is somewhat fragile since it relies on us understanding what haskell.nix is
89+
# doing internally!
90+
packages = ps: builtins.attrValues (haskellLib.selectProjectPackages ps);
91+
8192
tools = {
8293
haskell-language-server = {
8394
version = "latest";

0 commit comments

Comments
 (0)