git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #33217 from toonn/master

haskell docs: add info about hoogle's --local flag to section 9.5.2.3

commitf4df5d63f1931c972f935ff1bee9b60baf44047b authorSarah Brofeldt <sbrofeldt@gmail.com> dateTue 12 Jun 2018, 23:42 (8 years ago) parent96d6ef36caf7c9
1 file changed+21−2
doc/languages-frameworks/haskell.section.md+21−2
doc/languages-frameworks/haskell.section.md+21−2
@@ -334,10 +334,29 @@ navigate there.
334334
335335Finally, you can run
336336```shell
337−hoogle server -p 8080 --local
337+hoogle server --local -p 8080
338338```
339339and navigate to http://localhost:8080/ for your own local
340−[Hoogle](https://www.haskell.org/hoogle/).
340+[Hoogle](https://www.haskell.org/hoogle/). The `--local` flag makes the hoogle
341+server serve files from your nix store over http, without the flag it will use
342+`file://` URIs. Note, however, that Firefox and possibly other browsers
343+disallow navigation from `http://` to `file://` URIs for security reasons,
344+which might be quite an inconvenience. Versions before v5 did not have this
345+flag. See
346+[this page](http://kb.mozillazine.org/Links_to_local_pages_do_not_work) for
347+workarounds.
348+
349+For NixOS users there's a service which runs this exact command for you.
350+Specify the `packages` you want documentation for and the `haskellPackages` set
351+you want them to come from. Add the following to `configuration.nix`.
352+
353+```nix
354+services.hoogle = {
355+enable = true;
356+packages = (hpkgs: with hpkgs; [text cryptonite]);
357+haskellPackages = pkgs.haskellPackages;
358+};
359+```
341360
342361### How to build a Haskell project using Stack
343362