-
-
Save lf-/96c72180db1a4c0974a8737b7c423c23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Applies a list of overlays to the haskell package set rather than the entire | |
# nixpkgs, removing five levels of unsightly indentation. | |
{ overlays, ghcVer }: | |
self: super: | |
let | |
inherit (super.lib) foldr composeExtensions; | |
foldExtensions = foldr composeExtensions (_: _: {}); | |
in { | |
haskell = super.haskell // { | |
packages = super.haskell.packages // { | |
# overriding haskellPackages can produce surprising behaviour when | |
# multiple overrides are applied. We need to remember to include previous | |
# overrides in our overriding. | |
# https://github.com/NixOS/nixpkgs/issues/26561#issuecomment-354862897 | |
"${ghcVer}" = super.haskell.packages."${ghcVer}".override (old: { | |
overrides = composeExtensions | |
(old.overrides or (_: _: {})) | |
(foldExtensions (builtins.map (f: f { nixpkgs = self; }) overlays)); | |
}); | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment