3 ms·
I was just trying to get Nix working after needing a version of base (GHC) newer than what I had installed. The situation seems to have gotten a bit simpler wi
by buttproblem 11y ago
I was just trying to get Nix working after needing a version of base (GHC) newer than what I had installed.
The situation seems to have gotten a bit simpler with newer versions of the nix tools (this is of no fault of the author of this post, the post is more than a year old, their blog has great haskell stuff!).
Anyway, for haskell development you can just:
1. Write cabal file (e.g., ./project.cabal)
2. cabal2nix --shell . >shell.nix
3. nix-shell
After step 3, all the required packages, including stuff like GHC, will be installed. You can use cabal however you normally do to build the project:
4. cabal sandbox init
5. cabal build
- psibi 11y agoIs step 4 really required ? nix-shell already gives you a sandbox environment. Also their user manual[0] is really good now. [0]https://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download-by-type/doc/manual#users-guide-to-the-haskell-infrastructure https://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/down...