I do this with node and python projects. I develop using nix on a Mac, then deploy to NixOS servers.
One thing I've found handy is to create a .profile file in the root of my project directory with additional shell customization for that project (eg. bash functions for running my tests).
Then I have a function in my login profile that invokes nix shell (essentially) like this:
That makes it really easy to drop into a customized development environment, with all my dependencies taken care of, and which exactly corresponds to the environment that will be present at deployment time.
This drops you into a nix shell with all the dependencies for the project you're working on present.
You can also (especially easy if you're using projectile) run compile with the command nix-shell -I . shell.nix --command "cabal configure; cabal build" and that give you a nice list of type errors in your current project.
Repeatable builds with no cabal hell. In the words of disney: "I'm never going back, the past is in the past!"
Aside from perhaps the syntax of the Nix declarations (which isn't Haskell, though it is lazy etc.), is there anything holding you back from using Nix? As an alternative, are you familiar with Guix?
One thing I've found handy is to create a .profile file in the root of my project directory with additional shell customization for that project (eg. bash functions for running my tests).
Then I have a function in my login profile that invokes nix shell (essentially) like this:
That makes it really easy to drop into a customized development environment, with all my dependencies taken care of, and which exactly corresponds to the environment that will be present at deployment time.It's fantastic.