~kaction/cookiecutter-haskell

7f454cf9b26fb34fac20a06db443cca60dffab35 — Barry Moore 2 years ago c87c689
Add some documentation for hpack; fix default.nix template
2 files changed, 18 insertions(+), 2 deletions(-)

M README.md
M {{cookiecutter.project_name}}/default.nix
M README.md => README.md +17 -0
@@ 49,6 49,23 @@ docker load -i result

## Cheat Sheet

### Use the hpack configuration tool

When running cookiecutter, you'll be presented with the option of using cabal's
default configuration format or hpack. When using hpack, you will need to run
hpack to generate a cabal file before building, i.e.

```sh
hpack .
cabal build
```

The nix shell will contain `hpack` for local development and the nix build will
automatically handle changes to package.yaml. See [hpack-docs](the hpack
documentation) for more information.

[hpack-docs]: https://github.com/sol/hpack#hpack-a-modern-format-for-haskell-packages

### Run Hoogle locally

- `hoogle server --local -p 3000 -n`

M {{cookiecutter.project_name}}/default.nix => {{cookiecutter.project_name}}/default.nix +1 -2
@@ 26,8 26,7 @@ let
      pkgs.haskellPackages.ghcid
      pkgs.haskellPackages.ormolu
      pkgs.haskellPackages.hlint
      {% if cookiecutter.project_configuration_tool.startswith("package.yaml") %}
      pkgs.haskellPackages.hpack
      {% if cookiecutter.project_configuration_tool.startswith("package.yaml") %}pkgs.haskellPackages.hpack
      {% endif -%}
      pkgs.niv
      pkgs.nixpkgs-fmt