Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
The other day I needed to use a version of a package that isn't released on Hackage yet. After a bit of googling I came up with the following:
First run
cabal2nix --no-haddock --no-check --subpath core git://github.com/brendanhay/amazonka.git > amazonka-core.nix
to get an expression to build the package.
Then create a "new haskellPackages" overriding amazonka-core:
haskellPackages
amazonka-core
hp = haskellPackages.override { overrides = self: super: { amazonka-core = self.callPackage ./amazonka-core.nix {}; }; };
Finally, use hp.developPackage for the local source.
hp.developPackage
I rather like it, but I'm curious if that's how others would do it, or is there some better way?
you can do this a bit simpler:
amazonka-core = self.callCabal2nix "amazonka-core" (fetch{Tarball,Git,...} https://...) {};
this can benefit a lot from using niv, in which case you just write niv.amazonka-core for the fetch part and update the ref with the cli tool!
niv
niv.amazonka-core
fetch
The other day I needed to use a version of a package that isn't released on Hackage yet. After a bit of googling I came up with the following:
First run
to get an expression to build the package.
Then create a "new
haskellPackages
" overridingamazonka-core
:Finally, use
hp.developPackage
for the local source.I rather like it, but I'm curious if that's how others would do it, or is there some better way?
you can do this a bit simpler:
this can benefit a lot from using
niv
, in which case you just writeniv.amazonka-core
for thefetch
part and update the ref with the cli tool!