Skip to content

Commit 689dba5

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 689dba5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

nix/workbench/shell.nix

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

7979
inherit withHoogle;
8080

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

0 commit comments

Comments
 (0)