utdemir / hs-nix-template

A Haskell project template that uses Nix and comes with cabal-install, ghcid, ormolu, haskell-language-server and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding hpack?

chiroptical opened this issue · comments

Hey, I recently discovered this template and it is super helpful. I was wondering if you think adding hpack would be beneficial to the template? The nix build automatically picks it up and you don't have to add all of your modules to the cabal file.

I would gladly do the work, but I wanted to see if it aligns with your view of the project :)

Looks like this could be made as an option in cookiecutter pretty easily

e.g. https://cookiecutter.readthedocs.io/en/latest/advanced/hooks.html#example-conditional-files-directories

i.e. when useHpack is true, remove the cabal file; when false, remove the package.yaml

The nix build automatically picks it up and you don't have to add all of your modules to the cabal file.

I didn't know cabal2nix had hpack support, cool!

but I wanted to see if it aligns with your view of the project :)

Even though I am not a hpack user, I am happy with having it as an optional feature. What I would only ask is that if we could also extend the current tests somehow to test the new functionality.

I would gladly do the work,

Thanks! Let me know if there's anything I can help with.