Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add withHoogle nix-shell example #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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