[Nix-dev] package dependency problem: ghc-mod: cannot satisfy -package-id mtl-2.1.3.1
Peter Simons
simons at cryp.to
Thu Dec 18 14:06:20 CET 2014
Hi Paul,
>> NIX_GHC_VERSION=$(ghc --numeric-version)
>> export NIX_GHC="$HOME/.nix-profile/bin/ghc"
>> export NIX_GHCPKG="$HOME/.nix-profile/bin/ghc-pkg"
>> export NIX_GHC_DOCDIR="$HOME/.nix-profile/share/doc/ghc/html"
>> export NIX_GHC_LIBDIR="$HOME/.nix-profile/lib/ghc-${NIX_GHC_VERSION}"
>
> I'm not sure why ghc-mod needs these environment variables (shouldn't it
> be finding these things on the path?), but anyway, it all works now!
ghc-mod uses the 'ghc-paths' library to find out the necessary details
about the installed GHC binary. The problem with that library is that
it's fundamentally based on the assumption that there is *one* GHC and
all libraries are installed into its lib directory -- an assumption Nix
doesn't fulfill. We try to remedy that issue by patching ghc-paths [1]
so that it returns the contents of those environment variables above
instead of hard-coded (incorrect) values.
Best regards,
Peter
[1] https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/haskell/ghc-paths/ghc-paths-nix.patch
More information about the nix-dev
mailing list