Haskell project setup with haskell.nix

DEPRECATED: I'm now using this project instead.

This template was generated using the following steps:

Add cachix binary cache

cachix use iohk

Note: you should run the above as trusted user, otherwise you'll need to manually add the entry to trusted-substituters in /etc/nix/nix.conf

Set up niv

niv init
niv add input-output-hk/haskell.nix

Add Nix files

Set up cabal project

nix-shell -p cabal-install --command 'cabal init --cabal-version=2.4 --license=MIT -p haskell-nix-template'

Edit the generated .cabal file. Example in haskell-nix-template.cabal.

Create git repository and initial commit

Haskell.nix relies on git, so you must set up the git repository and commit the .cabal file before nix-shell will work.

git add .
git commit -m "Add haskell.nix skeleton"

Test nix-shell

nix-shell

Enable lorri (optional)

lorri init