This tool is used to update the Haskell package set in
nixpkgs
(hackage-packages.nix
).
Most of the time we do not need run this manually (since it is run automatically on the upstream nixpkgs). Exceptions:
-
To update the Haskell package set in nixpkgs.
-
To test that a structural change to nixpkgs (e.g. name change of a system package) does not break Haskell packages.
-
To test changes to
hackage2nix
itself.
There is a video on YouTube that gives a thorough walk-through of these steps.
It also explains many of the background considerations.
This must be run on a case sensitive file system.
On OSX you can use this to create one
(you can replace 60g
with 4g
as that should be plenty).
This shows the setup that nixpkgs Haskell maintainers use to iterate on both
cabal2nix
, hackage2nix
, and the Haskell package set in nixpkgs.
It clones cabal2nix
and puts a nixpkgs
checkout into it, which the
repo's update-nixpkgs.sh
script will update for you.
Replace [email protected]:NixOS/nixpkgs.git
with a fork you have push access
to.
git clone https://github.com/NixOS/cabal2nix.git
cd cabal2nix
git clone [email protected]:NixOS/nixpkgs.git # replace this with your fork
git clone https://github.com/commercialhaskell/all-cabal-hashes.git --branch hackage hackage
# For high reproducibility and pinned nixpkgs for native dependencies
# (you can leave `--nix` off on NixOS, or if you don't have nix installed):
stack --nix build
# Alternatively, to use Cabal's resolver:
cabal install
Runs hackage2nix and pushes a commit with the updated hackage-packages.nix
file to your fork of nixpkgs
.
./update-nixpkgs.sh