Closed Burtannia closed 2 months ago
Your dependencies come directly from nixpkgs
, and (like stack LTS'es) nixpkgs
pins the package versions for you. Unless you're publishing to hackage, there's usually no need to specify/worry about versions yourself, the versions in nixpkgs
usually just work together. If you want to update, nix flake update
updates all packages in lockstep. cabal update
is for when cabal manages your dependencies, which we don't want.
If the version bounds in your cabal file conflict with the versions in nixpkgs, you get the above error. If bumping nixpkgs/dropping version bounds is not an option, there are ways to inject a different version of a package into nixpkgs
, see here, specifically the part about callHackageDirect
.
Thanks :)
Hey, thanks for creating this repo.
I'm new to nix and NixOS so just had a couple of questions regarding Haskell on nix.
How does dependency management work? The
nix develop
shell includescabal
but can we usecabal update
andcabal gen-bounds
as usual?If we add dependency versions in our cabal file, does it work? I tried adding
containers == 0.7
(which matches the version in nixpkgs) to the template but runningnix develop
gives me:A bit of guidance on what the best practices are with Haskell/nix when it comes to dependency versions would be much appreciated.