Skip to content

Commit

Permalink
Add withHoogle nix-shell example
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanCacqueray committed Oct 17, 2020
1 parent 1888997 commit 0da80dd
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions project0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,32 @@ file suitable for the current project. However, this does not play nice with
advanced dependency management (covered in the next section) so I do not
recommend this approach in general.

# Local hoogle

You can also use this expression to configure a local hoogle service with
additional development tools by using the following `shell.nix` file:

```nix
{ pkgs ? import <nixpkgs> { } }:
pkgs.haskellPackages.shellFor {
withHoogle = true;
packages = p: [ (import ./release2.nix).project0 ];
buildInputs = [ pkgs.haskellPackages.hlint ];
}
```


... replacing `release2.nix` with the name of your project's derivation file.
Then you can just type:

```bash
$ nix-shell --command "hoogle server -p 8080 --local --haskell"
```

... and that will automatically serve a local hoogle with the documentation
of your project's dependencies.


# Conclusion

That concludes Nix workflow basics for Haskell development. The
Expand Down

0 comments on commit 0da80dd

Please sign in to comment.