mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-11 06:55:40 +03:00
This was a nice idea, but in practice it did not work unless you were explicitly extracting just `config`, `overlays` and `system` (see #542). ``` ~/iohk/haskell.nix$ nix-build -E 'import <nixpkgs> (import ./.)' error: anonymous function at /nix/store/f7mwvx7gl8lwjiqmpv60xapc3crvc474-nixpkgs-20.03pre194824.1f56d679f40/nixpkgs/pkgs/top-level/default.nix:20:1 called with unexpected argument '__functor', at /nix/store/f7mwvx7gl8lwjiqmpv60xapc3crvc474-nixpkgs-20.03pre194824.1f56d679f40/nixpkgs/pkgs/top-level/impure.nix:84:1 ``` This change will replace #542 errors with #709 errors.
34 lines
973 B
Nix
34 lines
973 B
Nix
{ checkMaterialization ? false # Allows us to easily switch on materialization checking
|
|
, defaultCompilerNixName ? null # Quick way to override the default compiler e.g. "ghc883"
|
|
, system ? builtins.currentSystem
|
|
, sourcesOverride ? {}
|
|
, ... }@args: rec {
|
|
sources = (import ./nix/sources.nix) // sourcesOverride;
|
|
|
|
config = import ./config.nix;
|
|
overlays = [ allOverlays.combined ] ++ (
|
|
if checkMaterialization == true
|
|
then [(
|
|
final: prev: {
|
|
haskell-nix = prev.haskell-nix // {
|
|
checkMaterialization = true;
|
|
};
|
|
}
|
|
)]
|
|
else []
|
|
) ++ (
|
|
if defaultCompilerNixName != null
|
|
then [(
|
|
final: prev: {
|
|
haskell-nix = prev.haskell-nix // {
|
|
inherit defaultCompilerNixName;
|
|
};
|
|
}
|
|
)]
|
|
else []
|
|
);
|
|
allOverlays = import ./overlays args;
|
|
nixpkgsArgs = { inherit config overlays system; };
|
|
pkgs = import sources.nixpkgs-default nixpkgsArgs;
|
|
}
|