summaryrefslogtreecommitdiffstats
path: root/pkgs/haskell/default.nix
blob: de6bd8055fed4cf6cded6906fb57b29c5e7d9bff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
let
  overrides = { lib, mylib }: self: super:
    mylib.mapNixDir (path: self.callPackage path {}) [
      ./.
    ] // {
    };
in
  self: super: let
    inherit (super) lib mylib;
  in {
    haskell = super.haskell // {
      packages = lib.mapAttrs (name: value:
        if builtins.hasAttr "override" value
          then value.override (old: {
            overrides =
              lib.composeExtensions (old.overrides or (_: _: { })) (overrides { inherit lib mylib; });
          })
          else value
      ) super.haskell.packages;
    };
    haskellPackages = super.haskellPackages.override (old: {
      overrides =
        lib.composeExtensions (old.overrides or (_: _: { })) (overrides { inherit lib mylib; });
    });
  }