haskell.nix/overlays/default.nix
Hamish Mackenzie d5d304d5b5
Flakify all inputs (#1180)
* Include dependencies of haskell.nix that were tracked in `nix/sources.json`
  as flake inputs (`flake.lock` replaces `nix/sources.json`).
* Use `flake-compat` to continue to provide a compatible interface for non
  flake projects.

Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
Co-authored-by: Shea Levy <shea@shealevy.com>
2021-08-06 15:54:39 +12:00

62 lines
1.7 KiB
Nix

{ sources, ...}@args:
let
overlays = {
wine = import ./wine.nix;
#ghcjs = import ./ghcjs-asterius-triple.nix;
#python = import ./python.nix;
haskell = import ./haskell.nix args;
hackage-quirks = import ./hackage-quirks.nix;
bootstrap = import ./bootstrap.nix;
ghc = import ./ghc.nix;
ghc-packages = import ./ghc-packages.nix;
darwin = import ./darwin.nix;
windows = import ./windows.nix;
armv6l-linux = import ./armv6l-linux.nix;
musl = import ./musl.nix;
tools = import ./tools.nix;
emscripten = import ./emscripten.nix;
nix-prefetch-git-minimal = import ./nix-prefetch-git-minimal.nix;
gobject-introspection = import ./gobject-introspection.nix;
hix = import ./hix.nix;
eval-packages = import ./eval-packages.nix combined;
ghcjs = import ./ghcjs.nix;
};
composeExtensions = f: g: final: prev:
let
fApplied = f final prev;
prev' = prev // fApplied;
in fApplied // g final prev';
ordered = with overlays; [
# Hide nixpkgs haskell and haskellPackages from the haskell-nix overlays.
# This should prevent us inadvertently depending on them.
(_: prev: {
haskell = { };
haskellPackages = { };
haskell-nix-prev = prev;
})
wine
haskell
hackage-quirks
bootstrap
ghc
ghc-packages
darwin
windows
armv6l-linux
musl
tools
emscripten
nix-prefetch-git-minimal
ghcjs
gobject-introspection
hix
eval-packages
# Restore nixpkgs haskell and haskellPackages
(_: prev: { inherit (prev.haskell-nix-prev) haskell haskellPackages; })
];
combined = builtins.foldl' composeExtensions (_: _: { }) ordered;
in overlays // { inherit combined; }