Modules ignored for shell tools
As per https://github.com/input-output-hk/haskell.nix/blob/master/overlays/tools.nix#L38, a shell tool should accept a modules argument which gets passed to cabalProject. However, as far as I can tell, this argument is entirely ignored - it can contain entirely spurious code
without any errors, and has no impact on the build.
Example of failing usage:
shell.tools = {
cabal = { };
hlint = { };
haskell-language-server = {
version = "latest";
modules = [{
pkgs.haskell-language-server.flags.haddockComments = false;
}];
};
ormolu = { };
};
modules are applied late in the process after the cabal solver has been used to pick a plan. modules can sometime be safely used to override flags chosen by cabal (in particular if they do not affect the set of packages needed in the plan). A better option in most cases is to tell cabal what flags should be so that the plan.json is constructed.
To do that for tools coming from hackage we need to provide a cabal.project file. Try:
shell.tools = {
cabal = { };
hlint = { };
haskell-language-server = {
version = "latest";
cabalProject = ''
packages: .
package haskell-language-server
flags: +haddockComments
'';
};
ormolu = { };
};
Closing. Please reopen if using cabalProject does not work. I think cabalProjectLocal also works for tools now, so you could also use:
shell.tools = {
cabal = { };
hlint = { };
haskell-language-server = {
version = "latest";
cabalProjectLocal = ''
package haskell-language-server
flags: +haddockComments
'';
};
ormolu = { };
};