From 0da80ddbb433b5adf11b31fac1b534dd0f63f9c4 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Sat, 17 Oct 2020 13:13:38 +0000 Subject: [PATCH] Add withHoogle nix-shell example Blocked-By: https://github.com/NixOS/nixpkgs/issues/82245 Fixes #33 --- project0/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/project0/README.md b/project0/README.md index 23eb21f..5cc12ca 100644 --- a/project0/README.md +++ b/project0/README.md @@ -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 { } }: +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