-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I override a dependency's source? (e.g. to build from a fork) #1293
Comments
Agreed, it would be great to be able to override package dependencies right from |
yes. You can override the
see: https://input-output-hk.github.io/haskell.nix/reference/modules/#packagessrc However this will only work if you are modifying the source, for changes to the cabal file, this is a bit trickier, as that would need to go into the hackage.nix index. We don't have support for hackage overlays yet, which would be really nice to have in this case to have a 9.2 compat hackage overlay (as an example head.hackage is a hackage overlay to facilitate working with ghc HEAD). |
Aha, good to know. That's still something. The cabal file is usually part of that tarball, so if I update the src location it could well have cabal file differences. Do I understand right that the problem is none of these differences will be used by |
I made a thing that seems work in all cases (even with cabal changes): https://github.com/ilyakooo0/haskell-nix-extra-hackage |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm not clear on how I'm supposed to override a package's source using haskell.nix infrastructure. (e.g. at the moment there are a lot of packages that don't build on 9.2.1 that have pull requests floating around to enable them to build; overriding sources to use these pull requests gets my project building in the meantime). Using straight nixpkgs I would have used an overlay.
I've found if I list a
source-repository-package
incabal.project
I can override it provided the dependency is only a direct dependency. If it's a dependency of a dependency then haskell.nix doesn't provide thesource-repository-package
version when building the dependency; I can addsource-repository-pacage
stanzas all the way down the dependency chain, of course, but that's extremely tedious if it's more than a few levels deep.Is this something I can do with the
modules
orpkg-def-extras
arguments tocabalProject'
?Would be great to have an example in the docs.
The text was updated successfully, but these errors were encountered: