on c3f4882 help sign in
haskell.nix/docs/tutorials/hackage-stackage.md
36 lines 2.0 kB history raw
1# Bumping Hackage and Stackage snapshots
3`haskell.nix` relies on some generated data providing information about packages in Hackage and Stackage snapshots.
4These are kept in [`hackage.nix`](https://github.com/input-output-hk/hackage.nix) and [`stackage.nix`](https://github.com/input-output-hk/stackage.nix) respectively.
5If your project depends on a Hackage package, then the `hackage.nix` revision used must be new enough to contain that, and likewise for Stackage snaphots and `stackage.nix`.
7## Updating and pinning `hackage.nix` and `stackage.nix`
9`haskell.nix` pins particular revisions of these repositories internally, both for our own usage in testing, and so that users have a sensible default when getting started.
10These revisions are updated nightly, so you can get newer revisions of `hackage.nix` and `stackage.nix` by updating your revision of `haskell.nix` itself.
12However, this exposes you to changes in `haskell.nix` which you may not want, such as changes that force compiler rebuilds, or the occasional bug.
13Instead, you can pin `hackage.nix` and `stackage.nix` independently. For example:
15```nix
16let
17 # You can use a tool like `niv` to manage this boilerplate
18 hackageSrc = builtins.fetchTarball https://github.com/input-output-hk/hackage.nix/archive/master.tar.gz;
19 stackageSrc = builtins.fetchTarball https://github.com/input-output-hk/stackage.nix/archive/master.tar.gz;
20 haskellSrc = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz;
22 haskellNix = import haskellSrc {
23 # This allows you to override the pins used by `haskell.nix` internally
24 sourcesOverride = {
25 hackage = hackageSrc;
26 stackage = stackageSrc;
27 };
28 };
29in ...
30```
32This way you can change the revisions of `hackage.nix` and `stackage.nix`
33without changing `haskell.nix`.
35However, bear in mind that Stackage refers to Hackage, so your Stackage pin
36should never be newer than your Hackage pin.