I was trying to build an old Haskell project with an older nixpkgs channel/branch (18.03
).
On my first attempt of building it, I specified the compiler version as ghc843
... However when building - it seemed to be building ALL the the external libraries when I'd expect it to be coming from the cache.
Luckily I remembered I ran into this issue previously: Debugging why nix is building a package unnecessarily when it should be in nixpkgs binary cache?
Where the issue was basically I was using a "non default" version of ghc (which Hydra would not have built / cached).
So now my question is, how can I find out what is the "default" compiler version - or the one that Hydra built/cached?
{
nixpkgs ? import <nixpkgs> {}
, sources ? import ./nix/sources.nix
, compiler ? "ghc843" } :
let
niv = import sources.nixpkgs {
overlays = [
(_ : _ : { niv = import sources.niv {}; })
] ;
config = {};
};
pkgs = niv.pkgs;
myHaskellPackages = pkgs.haskell.packages.${compiler}.override {
};
in
(myHaskellPackages.callCabal2nix "abc" (./.) {})
Just by chance I tried ghc823
which seems to be the default (or at least had cached assets in Hydra).
I figuered out how to list the available ghc compiler versions using the nix repl like so:
nix-repl> yolo = (import nix/sources.nix {})
nix-repl> yolo.blablaTestTabCompletion
nix-repl> yolo2 = (import yolo.nixpkgs {})
nix-repl> yolo2.haskell.packages.
yolo2.haskell.packages.ghc7103 yolo2.haskell.packages.ghc843
yolo2.haskell.packages.ghc7103Binary yolo2.haskell.packages.ghcHEAD
yolo2.haskell.packages.ghc802 yolo2.haskell.packages.ghcjs
yolo2.haskell.packages.ghc821Binary yolo2.haskell.packages.ghcjsHEAD
yolo2.haskell.packages.ghc822 yolo2.haskell.packages.integer-simple
yolo2.haskell.packages.ghc841