4 ms·
I have never used stack: I went from cabal-install hell straight to NixOS. My current approach is: write the usual .cabal file, run cabal2nix --shell . > de
by rnhmjoj 11y ago
I have never used stack: I went from cabal-install hell straight to NixOS.
My current approach is: write the usual .cabal file, run
cabal2nix --shell . > default.nix
then build and install the package (with `nix-build` or `nix-env -if.`) or open a nix-shell (just `nix-shell` in the project root) where I can run cabal-install to do things like uploading to hackage, building haddock docs, using cabal repl.
The nix expression is deterministically generated by the .cabal so unless you update the nix channel it won't change and you can safely delete it and regenerate it at anytime. While stack.yaml is not, or not entirely generate, if I understand correctly.
Are there other advantages over cabal2nix beside parallelization and incremental recompilation? I hardly handle 2 package at once so it's not really an issue for me.
- mboes 11y agoIncremental recompilation is a big one, but beyond that, out-of-the-box handling of multi-package projects without the hassle of custom scripting or setting up .nix files just right. If all your projects are single package, `cabal repl` should work pretty well. Where stack really shines, and where it's interesting to simply reuse that, is for multi-package repos, which tend to be very common in private company Haskell developments.