Skip to content

Commit

Permalink
Fix the workbench shell
Browse files Browse the repository at this point in the history
Using `cabalWrapped` also requires us to mess with `haskell.nix`'s
choices for what packages to prepare the shell for.
  • Loading branch information
michaelpj committed Oct 11, 2022
1 parent a0b0003 commit 689dba5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nix/workbench/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ in project.shellFor {

inherit withHoogle;

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

tools = {
haskell-language-server = {
version = "latest";
Expand Down

0 comments on commit 689dba5

Please sign in to comment.