The Haskell ecosystem in Nixpkgs generally follows either the latest LTS, or Stackage Nightly.
Currently, master
and haskellupdates
are on LTS18, which has random1.2.0
. So haskellPackages.random
is random1.2.0
.
The Haskell builder in Nixpkgs doesnâ€™t have a solver (unlike cabalinstall
), so Nix isnâ€™t really â€śchoosingâ€ť random1.2.0
. random1.2.0
is just the version currently in haskellPackages
.
This is quite hard to tell from lapack: Numerical Linear Algebra using LAPACK, but lapack
does actually depend on random
in the lapacktest
component: https://hackage.haskell.org/package/lapack0.3.2/lapack.cabal
There are a couple things to keep in mind here:
 If you donâ€™t tell us what resolver
stack
ends up using, it is hard for anyone to verify this. stack
could end up picking some really old LTS (like LTS6 or something). But that doesnâ€™t really help us, since Nixpkgs is on LTS18.

stack
doesnâ€™t build and run tests when you try to install an arbitrary package. The Nixpkgs Haskell stuff does. This random
problem appears to be caused in the tests.
So how to get lapack
building?
Since lapack0.3.2
is in LTS18, my first guess would be to just disable the tests:
$ nix repl ./.
nixrepl> :b haskell.lib.compose.dontCheck (haskell.lib.compose.markUnbroken haskellPackages.lapack)
this derivation produced the following outputs:
doc > /nix/store/mk6s49a6dl0spkdrkmw1xjw15v0f59dwlapack0.3.2doc
out > /nix/store/3lb0p26z2gqb753crf7pfzgnrpvwkspplapack0.3.2
It looks like we got lucky and this worked!
It would be really great if you could send a PR to the haskellupdates
branch in Nixpkgs adding this fix.
Basically, you just have to do the following two things:
 Remove
lapack
from the list of broken packages: nixpkgs/broken.yaml at e31f392946cfce8a6ded8716f438bf670b0ce0da Â· NixOS/nixpkgs Â· GitHub
 Add an override saying not to run
lapack
's tests. Similar to a line like nixpkgs/configurationcommon.nix at e31f392946cfce8a6ded8716f438bf670b0ce0da Â· NixOS/nixpkgs Â· GitHub, but for lapack
.