The utils.nix file provides me with a simple function to fetch a given nix channel.
I'm using it to fetch nixos-19.09
where amazonka
has been marked as broken.
nix-repl> utils = import ./utils.nix
nix-repl> overlays = [ ((import ./amazonka.nix) ]
Here, I'm fetching an older nix channel in which amazonka
is marked as broken.
the point of the overlay above is to "fix" amazonka
with a manual override in which I fetch the amazonka
src.
and replace the broken amazonka
packages.
nix-repl> oldPkgs = import (utils.fetchNixChannel "nixos-19.09") { inherit overlays; }
This works, and the overlays do get applied. For example, amazonka-core
is no longer broken, since the following doesn't refuse to evaluate:
nix-repl> oldPkgs.haskellPackages.amazonka-core
«derivation /nix/store/x8gz5is6p5nkgmfv4pgfkvzr7ijw7ril-amazonka-core-1.6.1.drv»
As one might expect, amazonka
is now also marked as not-broken, since when trying to evaluate amazonka
, the broken warning doesn't get issued because of amazonka
but because of amazonka-core
:
nix-repl> oldPkgs.haskellPackages.amazonka
error: Package ‘amazonka-core-1.6.1’ in /nix/store/15mm3lzryjh0q0yg4jncr48awpkwhzvy-source/pkgs/development/haskell-modules/hackage-packages.nix:25945 is marked as broken, refusing to evaluate.
a) For `nixos-rebuild` you can set
{ nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.
b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
The issue here is that I've overriden amazonka-core
in my overlay.
But amazonka
seems to be wired to a version of amazonka-core
that has not been overlayed.
It somewhat makes sense to me that this is the correct thing to do on nix's part.
However, I find it confusing still: and how can this be overcome?