on iko/ghcjs-patch-master help sign in
Use NixOS module system
d18913eWill Fancher
builder/default.nix+11−23
@@ -1,14 +1,16 @@
1{ pkgs, stdenv, lib, haskellLib, ghc, fetchurl, writeText, runCommand, pkgconfig }:
1{ pkgs, stdenv, lib, haskellLib, ghc, fetchurl, writeText, runCommand, pkgconfig }:
2
2
3−{ flags ? {}
3+{ flags
4−, package ? {}
4+, package
5−, components ? {}
5+, components
6
6
7−, name ? "${package.identifier.name}-${package.identifier.version}"
7+, name
8−, sha256 ? null
8+, sha256
9−, src ? fetchurl { url = "mirror://hackage/${name}.tar.gz"; inherit sha256; }
9+, src
10−, revision ? null
10+, revision
11−, revisionSha256 ? null
11+, revisionSha256
12+
13+, ...
12}@config:
14}@config:
13
15
14let
16let
@@ -56,21 +58,7 @@ let
56 comp-builder = haskellLib.weakCallPackage pkgs ./comp-builder.nix { inherit ghc haskellLib; };
58 comp-builder = haskellLib.weakCallPackage pkgs ./comp-builder.nix { inherit ghc haskellLib; };
57
59
58 buildComp = componentId: component: comp-builder {
60 buildComp = componentId: component: comp-builder {
59− inherit componentId package name src flags setup cabalFile;
61+ inherit componentId component package name src flags setup cabalFile;
60− component =
61− let
62− nonNullLists = fs: component // lib.genAttrs fs (field:
63− if component ? ${field}
64− then builtins.filter (x: x != null) component.${field}
65− else []);
66− in nonNullLists [
67− "depends"
68− "libs"
69− "frameworks"
70− "pkgconfig"
71− "build-tools"
72− "configureFlags"
73− ];
74 };
62 };
75
63
76in {
64in {
default.nix+3−1
@@ -2,5 +2,7 @@ hackage: let haskell = {
2 compat = import ./compat hackage;
2 compat = import ./compat hackage;
3 mkPkgSet = pkgs: pkg-def: import ./package-set.nix { inherit pkg-def pkgs hackage haskell; };
3 mkPkgSet = pkgs: pkg-def: import ./package-set.nix { inherit pkg-def pkgs hackage haskell; };
4 # The *new* pkg set is one that build components.
4 # The *new* pkg set is one that build components.
5+ # This also uses the module system for much greater extensibility.
6+ # To make extend and override things, pass a modules argument to new-package-set.nix
5− mkNewPkgSet = pkgs: pkg-def: import ./new-package-set.nix { inherit pkgs hackage; planFunc = pkg-def; };
7+ mkNewPkgSet = pkgs: pkg-def: import ./new-package-set.nix { inherit hackage pkgs pkg-def; };
6}; in haskell
8}; in haskell
modules/cabal.nixnew file+30
@@ -0,0 +1,30 @@
1+{ lib, config, pkgs, ... }:
2+
3+let
4+ # it also crucially depends on system, and compiler, both of which need to be resolved to the
5+ # current system being targetted.
6+ hostMap = import ../lib/host-map.nix pkgs.stdenv;
7+ cabal = import ../lib/cabal-os-arch-comp.nix;
8+
9+ compiler = cabal.compiler // {
10+ isGhc = true;
11+ version = lib.mapAttrs (_: f: v: f (builtins.compareVersions config.compiler.version v)) {
12+ eq = c: c == 0;
13+ gt = c: c > 0;
14+ ge = c: c >= 0;
15+ lt = c: c < 0;
16+ le = c: c <= 0;
17+ };
18+ };
19+ system = cabal.os // { "is${hostMap.os}" = true; }
20+ // cabal.arch // { "is${hostMap.arch}" = true; };
21+
22+in {
23+ options.cabal.compiler = lib.mkOption {
24+ type = lib.types.unspecified;
25+ };
26+ options.cabal.system = lib.mkOption {
27+ type = lib.types.unspecified;
28+ };
29+ config.cabal = { inherit compiler system; };
30+}
modules/compat-driver.nixnew file+19
@@ -0,0 +1,19 @@
1+{ lib, config, pkgs, haskellLib, ... }:
2+
3+{
4+ options.hsPkgs = lib.mkOption {
5+ type = lib.types.unspecified;
6+ };
7+
8+ config.hsPkgs = pkgs.callPackage "${pkgs.path}/pkgs/development/haskell-modules" {
9+ haskellLib = pkgs.haskell.lib;
10+ ghc = config.ghc.package;
11+ buildHaskellPackages = config.hsPkgs;
12+ compilerConfig = _: _: lib.mapAttrs (_: _: null) (builtins.removeAttrs config.compiler.packages ["ghc"]);
13+ initialPackages = args: self:
14+ lib.mapAttrs
15+ (_: pkg: self.callPackage ../compat/driver.nix { expr = pkg; inherit lib; })
16+ config.packages;
17+ packageSetConfig = config.overlay pkgs;
18+ };
19+}
modules/component-driver.nixnew file+18
@@ -0,0 +1,18 @@
1+{ config, pkgs, lib, haskellLib, ... }:
2+let
3+ # TODO: this pkgs is the adjusted pkgs, but pkgs.pkgs is unadjusted
4+ new-builder = haskellLib.weakCallPackage pkgs ../builder {
5+ inherit haskellLib;
6+ ghc = config.ghc.package;
7+ };
8+in
9+
10+{
11+ options.hsPkgs = lib.mkOption {
12+ type = lib.types.unspecified;
13+ };
14+
15+ config.hsPkgs = { buildPackages = config.hsPkgs; }
16+ // lib.mapAttrs (_: _: null) config.compiler.packages
17+ // lib.mapAttrs (_: pkg: if pkg == null then null else new-builder pkg) config.packages;
18+}
modules/hackage.nixnew file+81
@@ -0,0 +1,81 @@
1+{ lib, config, pkgs, ... }:
2+
3+let
4+ # hackage looks like the following:
5+ # { "package-name" =
6+ # { "a.b.c.d" =
7+ # rec { sha256 = $pkgVersionSha256;
8+ # revisions =
9+ # { r0 = { outPath = ./hackage/...; revNum = 0; sha256 = $revisionSha256; };
10+ # default = revisions.r0; };
11+ # };
12+ # };
13+ # };
14+ # }
15+
16+
17+ # However it's more convenient to deal with the leaf nodes, and as such
18+ # push the `sha256` of the package/version into the revision and keep the
19+ # revision.sha256 as revisionSha256; as well as making the revision content
20+ # addressable by it's revision hash.
21+ #
22+ # Thus we transform hackage into hackageConfigs, which will look like:
23+ # { "package-name" =
24+ # { "a.b.c.d" =
25+ # rec { sha256 = $packageVersionSha256;
26+ # revisions =
27+ # { r0 = { outPath = ./hackage/...;
28+ # sha256 = $packageVersionSha256;
29+ # revision = $revNum;
30+ # revisionSha256 = $revisionSha256; };
31+ # default = revisions.r0;
32+ # $revisionSha256 = revisions.r0; };
33+ # };
34+ # };
35+ # };
36+ # }
37+
38+ hackageConfigs =
39+ lib.flip lib.mapAttrs config.hackage.db
40+ (pname: lib.mapAttrs
41+ (vnum: version: version // {
42+ revisions =
43+ let
44+ rev2Config = rev: {
45+ inherit (version) sha256;
46+ inherit (rev) outPath;
47+ revision = rev.revNum;
48+ revisionSha256 = rev.sha256;
49+ };
50+ f = rev: acc: acc // {
51+ # If there's a collision (e.g. a revision was
52+ # reverted), pick the one with the smaller
53+ # revNum. They're identical, but if the smaller one is
54+ # r0 then we don't have to download a cabal file.
55+ ${rev.sha256} = if lib.hasAttr rev.sha256 acc && acc.${rev.sha256}.revNum < rev.revNum
56+ then acc.${rev.sha256}
57+ else rev;
58+ };
59+ contentAddressedRevs = lib.foldr f {} (builtins.attrValues version.revisions);
60+ in lib.mapAttrs (_: rev2Config) (version.revisions // contentAddressedRevs);
61+ }));
62+
63+in {
64+ options.ghc.package = lib.mkOption {
65+ type = lib.types.package;
66+ # obtain the compiler from the haskell packages.
67+ # this should allow us to use `config` overrides
68+ # in the nixpkgs setup, and properly override the
69+ # complier as needed.
70+ default = pkgs.haskell.compiler.${config.compiler.nix-name};
71+ defaultText = "pkgs.haskell.compiler.\${config.compiler.nix-name}";
72+ };
73+
74+ options.hackage.db = lib.mkOption {
75+ type = lib.types.unspecified; # TODO: Worth type checking with modules? Or does that slow eval too much?
76+ };
77+ options.hackage.configs = lib.mkOption {
78+ type = lib.types.unspecified;
79+ };
80+ config.hackage.configs = hackageConfigs;
81+}
modules/package.nixnew file+177
@@ -0,0 +1,177 @@
1+# package descriptions in hackage will look like:
2+# { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs }:
3+# { flags = { flag1 = false; flags2 = true; ... };
4+# package = { specVersion = "X.Y"; identifier = { name = "..."; version = "a.b.c.d"; };
5+# license = "..."; copyright = "..."; maintainer = "..."; author = "...";
6+# homepage = "..."; url = "..."; synopsis = "..."; description = "...";
7+# buildType = "Simple"; # or Custom, Autoconf, ...
8+# };
9+# components = {
10+# "..." = { depends = [ (hsPkgs.base) ... ]; };
11+# exes = { "..." = { depends = ... };
12+# "..." = { depends = ... }; };
13+# tests = { "..." = { depends = ... }; ... };
14+# };
15+
16+{ lib, config, pkgs, ... }:
17+
18+with lib;
19+with types;
20+
21+let
22+ # This is just like listOf, except that it filters out all null elements.
23+ listOfFilteringNulls = elemType: listOf elemType // {
24+ # Mostly copied from nixpkgs/lib/types.nix
25+ merge = loc: defs:
26+ map (x: x.value) (filter (x: x ? value && x.value != null) (concatLists (imap1 (n: def:
27+ if isList def.value then
28+ imap1 (m: def':
29+ (mergeDefinitions
30+ (loc ++ ["[definition ${toString n}-entry ${toString m}]"])
31+ elemType
32+ [{ inherit (def) file; value = def'; }]
33+ ).optionalValue
34+ ) def.value
35+ else
36+ throw "The option value `${showOption loc}` in `${def.file}` is not a list.") defs)));
37+ };
38+in {
39+ # This is how the Nix expressions generated by *-to-nix receive
40+ # their flags argument.
41+ config._module.args.flags = config.flags;
42+
43+ options = {
44+ # TODO: Add descriptions to everything.
45+ flags = mkOption {
46+ type = attrsOf bool;
47+ };
48+
49+ package = {
50+ specVersion = mkOption {
51+ type = str;
52+ };
53+
54+ identifier.name = mkOption {
55+ type = str;
56+ };
57+
58+ identifier.version = mkOption {
59+ type = str;
60+ };
61+
62+ license = mkOption {
63+ type = str;
64+ };
65+
66+ copyright = mkOption {
67+ type = str;
68+ };
69+
70+ maintainer = mkOption {
71+ type = str;
72+ };
73+
74+ author = mkOption {
75+ type = str;
76+ };
77+
78+ homepage = mkOption {
79+ type = str;
80+ };
81+
82+ url = mkOption {
83+ type = str;
84+ };
85+
86+ synopsis = mkOption {
87+ type = str;
88+ };
89+
90+ description = mkOption {
91+ type = str;
92+ };
93+
94+ buildType = mkOption {
95+ type = str;
96+ };
97+ };
98+
99+ components = let
100+ componentType = submodule {
101+ options = {
102+ depends = mkOption {
103+ type = listOfFilteringNulls unspecified;
104+ default = [];
105+ };
106+ libs = mkOption {
107+ type = listOfFilteringNulls (nullOr package);
108+ default = [];
109+ };
110+ frameworks = mkOption {
111+ type = listOfFilteringNulls package;
112+ default = [];
113+ };
114+ pkgconfig = mkOption {
115+ type = listOfFilteringNulls package;
116+ default = [];
117+ };
118+ build-tools = mkOption {
119+ type = listOfFilteringNulls unspecified;
120+ default = [];
121+ };
122+ configureFlags = mkOption {
123+ type = listOfFilteringNulls str;
124+ default = [];
125+ };
126+ };
127+ };
128+ in {
129+ library = mkOption {
130+ type = componentType;
131+ };
132+ sublibs = mkOption {
133+ type = attrsOf componentType;
134+ default = {};
135+ };
136+ foreignlibs = mkOption {
137+ type = attrsOf componentType;
138+ default = {};
139+ };
140+ exes = mkOption {
141+ type = attrsOf componentType;
142+ default = {};
143+ };
144+ tests = mkOption {
145+ type = attrsOf componentType;
146+ default = {};
147+ };
148+ benchmarks = mkOption {
149+ type = attrsOf componentType;
150+ default = {};
151+ };
152+ };
153+
154+ name = mkOption {
155+ type = str;
156+ default = "${config.package.identifier.name}-${config.package.identifier.version}";
157+ defaultText = "\${config.package.identifier.name}-\${config.package.identifier.version}";
158+ };
159+ sha256 = mkOption {
160+ type = nullOr str;
161+ default = null;
162+ };
163+ src = mkOption {
164+ type = either path package;
165+ default = pkgs.fetchurl { url = "mirror://hackage/${config.name}.tar.gz"; inherit (config) sha256; };
166+ defaultText = "pkgs.fetchurl { url = \"mirror://hackage/\${config.name}.tar.gz\"; inherit (config) sha256; };";
167+ };
168+ revision = mkOption {
169+ type = nullOr int;
170+ default = null;
171+ };
172+ revisionSha256 = mkOption {
173+ type = nullOr str;
174+ default = null;
175+ };
176+ };
177+}
modules/plan.nixnew file+63
@@ -0,0 +1,63 @@
1+# The plan (that is, a package set description like an LTS set or a
2+# plan.nix (derived from plan.json)) will producde a structure that
3+# looks like, which is stored in config.plan.pkg-def:
4+#
5+# { packages = { "package" = { revision = hackageConfigs.$package.$version.revisions.default;
6+# flags = { flag1 = true; flag2 = false; ... }; };
7+# ... };
8+# compiler = { version = "X.Y.Z"; nix-name ="ghcXYZ";
9+# # packages that come bundled with the compiler
10+# packages = { "bytestring" = "a.b.c.d"; ... }; };
11+# }
12+
13+{ lib, config, pkgs, pkgconfPkgs, ... }:
14+
15+with lib;
16+with types;
17+
18+{
19+ options = {
20+ packages = mkOption {
21+ type = attrsOf (submodule {
22+ imports = [./package.nix];
23+ _module.args = {
24+ inherit pkgs pkgconfPkgs;
25+ inherit (config) hsPkgs;
26+ inherit (config.cabal) system compiler;
27+ };
28+ });
29+ };
30+
31+ compiler = {
32+ version = mkOption {
33+ type = str;
34+ };
35+ nix-name = mkOption {
36+ type = str;
37+ };
38+ packages = mkOption {
39+ type = attrsOf str;
40+ };
41+ };
42+
43+ overlay = mkOption {
44+ type = unspecified; # Ignored. TODO: Remove and use the module system instead
45+ };
46+
47+ plan.pkg-def = mkOption {
48+ type = unspecified;
49+ visible = false;
50+ internal = true;
51+ };
52+ };
53+
54+ config = let module = config.plan.pkg-def config.hackage.configs; in {
55+ inherit (module) compiler overlay;
56+ packages = lib.mapAttrs (_: { revision, ... }@revArgs: { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }@modArgs:
57+ let m = import revision.outPath modArgs;
58+ in m
59+ // builtins.removeAttrs revision ["outPath"]
60+ // { flags = lib.mapAttrs (_: lib.mkDefault) (m.flags // revArgs.flags or {}); }
61+ ) module.packages;
62+ };
63+}
new-package-set.nix+37−170
@@ -1,170 +1,37 @@
1−{ pkgs ? import <nixpkgs> {}
1+{ hackage, pkgs, pkg-def, modules ? [] }: pkgs.lib.evalModules {
2−, planFunc ? import ../stackage/lts-11.4.nix
2+ modules = modules ++ [
3−, hackage ? import ../hackage
3+ ({ lib, ... }: {
4−, driver ? ./nix/component-driver.nix
4+ # Provide all modules with haskellLib, pkgs, and pkgconfPkgs arguments
5−}:
5+ _module.args = {
6−
7−{ extraDeps ? hsPkgs: {} }:
8−(pkgs.lib.fix (self: with self; {
9− inherit (pkgs) lib stdenv;
10−
11− # obtain the compiler from the haskell packages.
12− # this should allow us to use `config` overrides
13− # in the nixpkgs setup, and properly override the
14− # complier as needed.
15− ghc = pkgs.haskell.compiler.${plan.compiler.nix-name};
16−
17− # this is *not* the hasekllLib from nixpkgs; it is rather our own
6+ # this is *not* the hasekllLib from nixpkgs; it is rather our own
18− # library from haskell.nix
7+ # library from haskell.nix
19− haskellLib = import ./lib { inherit lib haskellLib; };
8+ haskellLib = let hl = import ./lib { inherit lib; haskellLib = hl; }; in hl;
20−
9+
21− # hackage looks like the following:
22− # { "package-name" =
23− # { "a.b.c.d" =
24− # rec { sha256 = $pkgVersionSha256;
25− # revisions =
26− # { r0 = { outPath = ./hackage/...; revNum = 0; sha256 = $revisionSha256; };
27− # default = revisions.r0; };
28− # };
29− # };
30− # };
31− # }
32−
33−
34− # However it's more convenient to deal with the leaf nodes, and as such
35− # push the `sha256` of the package/version into the revision and keep the
36− # revision.sha256 as revisionSha256; as well as making the revision content
37− # addressable by it's revision hash.
38− #
39− # Thus we transform hackage into hackageConfigs, which will look like:
40− # { "package-name" =
41− # { "a.b.c.d" =
42− # rec { sha256 = $packageVersionSha256;
43− # revisions =
44− # { r0 = { outPath = ./hackage/...;
45− # sha256 = $packageVersionSha256;
46− # revision = $revNum;
47− # revisionSha256 = $revisionSha256; };
48− # default = revisions.r0;
49− # $revisionSha256 = revisions.r0; };
50− # };
51− # };
52− # };
53− # }
54−
55− hackageConfigs =
56− lib.flip lib.mapAttrs hackage
57− (pname: lib.mapAttrs
58− (vnum: version: version // {
59− revisions =
60− let
61− rev2Config = rev: {
62− inherit (version) sha256;
63− inherit (rev) outPath;
64− revision = rev.revNum;
65− revisionSha256 = rev.sha256;
66− };
67− f = rev: acc: acc // {
68− # If there's a collision (e.g. a revision was
69− # reverted), pick the one with the smaller
70− # revNum. They're identical, but if the smaller one is
71− # r0 then we don't have to download a cabal file.
72− ${rev.sha256} = if lib.hasAttr rev.sha256 acc && acc.${rev.sha256}.revNum < rev.revNum
73− then acc.${rev.sha256}
74− else rev;
75− };
76− contentAddressedRevs = lib.foldr f {} (builtins.attrValues version.revisions);
77− in lib.mapAttrs (_: rev2Config) (version.revisions // contentAddressedRevs);
78− }));
79−
80− # The planFunc (that is, a package set description like an LTS set
81− # or a plan.nix (derived from plan.json)) will then producde a structure
82− # that looks like:
83− #
84− # { packages = { "package" = { revision = hackageConfigs.$package.$version.revisions.default;
85− # flags = { flag1 = true; flag2 = false; ... }; };
86− # ... };
87− # compiler = { version = "X.Y.Z"; nix-name ="ghcXYZ";
88− # # packages that come bundled with the compiler
89− # packages = { "bytestring" = "a.b.c.d"; ... }; };
90− # }
91−
92− # package descriptions in hackage will look like:
93− # { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs }:
94− # { flags = { flag1 = false; flags2 = true; ... };
95− # package = { specVersion = "X.Y"; identifier = { name = "..."; version = "a.b.c.d"; };
96− # license = "..."; copyright = "..."; maintainer = "..."; author = "...";
97− # homepage = "..."; url = "..."; synopsis = "..."; description = "...";
98− # buildType = "Simple"; # or Custom, Autoconf, ...
99− # };
100− # components = {
101− # "..." = { depends = [ (hsPkgs.base) ... ]; };
102− # exes = { "..." = { depends = ... };
103− # "..." = { depends = ... }; };
104− # tests = { "..." = { depends = ... }; ... };
105− # };
106−
107− # The package descriptions depend on pkgs, which are used to resolve system package dependencies
10+ # The package descriptions depend on pkgs, which are used to resolve system package dependencies
108− # as well as pkgconfPkgs, which are used to resolve pkgconfig name to nixpkgs names. We simply
11+ # as well as pkgconfPkgs, which are used to resolve pkgconfig name to nixpkgs names. We simply
109− # augment the existing pkgs set with the specific mappings:
12+ # augment the existing pkgs set with the specific mappings:
110− adjustedPkgs = pkgs // (import ./lib/system-nixpkgs-map.nix pkgs);
13+ pkgs = pkgs // (import ./lib/system-nixpkgs-map.nix pkgs);
111− pkgconfPkgs = pkgs // (import ./lib/pkgconf-nixpkgs-map.nix pkgs);
14+ pkgconfPkgs = pkgs // (import ./lib/pkgconf-nixpkgs-map.nix pkgs);
112−
15+ };
113− # it also crucially depends on system, and compiler, both of which need to be resolved to the
16+
114− # current system being targetted.
17+ # Set the hackage DB for modules/hackage.nix
115− hostMap = import ./lib/host-map.nix pkgs.stdenv;
18+ hackage.db = hackage;
116− cabal = import ./lib/cabal-os-arch-comp.nix;
19+
117−
20+ # Set the plan for modules/plan.nix
118− compiler = cabal.compiler // {
21+ plan.pkg-def = pkg-def;
119− isGhc = true;
22+ })
120− version = lib.mapAttrs (_: f: v: f (builtins.compareVersions plan.compiler.version v)) {
23+
121− eq = c: c == 0;
24+ # Supplies metadata
122− gt = c: c > 0;
25+ ./modules/cabal.nix
123− ge = c: c >= 0;
26+
124− lt = c: c < 0;
27+ # Converts config.packages into config.hsPkgs
125− le = c: c <= 0;
28+ # Replace this with compat-driver.nix to use nixpkgs haskell build infra
29+ ./modules/component-driver.nix
30+
31+ # Converts config.hackage.db to config.hackage.configs
32+ ./modules/hackage.nix
33+
34+ # Converts config.hackage.configs and pkg-def to config.packages
35+ ./modules/plan.nix
36+ ];
126− };
37+}
127− };
128− system = cabal.os // { "is${hostMap.os}" = true; }
129− // cabal.arch // { "is${hostMap.arch}" = true; };
130−
131− # Therefore the arguments we pass to the package are
132− pkgArgs = { inherit compiler system pkgconfPkgs; pkgs = adjustedPkgs; };
133−
134− # we can never reinstall the following set of packages:
135− nonReinstallables
136− = [ "rts" "ghc" "base" "ghc-prim" "array" "integer-gmp" "integer-simple"
137− "deepseq" "pretty" "ghc-boot-th" "template-haskell" "terminfo" ];
138− # Thus the final plan will contain
139− # { packages = hsPkgs: { "package" = { flags = ...; package = ...; components = ...; }; ... };
140− # compiler = ... };
141−
142− plan =
143− let p = planFunc hackageConfigs;
144− in p // {
145− packages = hsPkgs:
146− (lib.mapAttrs (pname: { revision, flags ? {} }: self:
147− # Set the flags with the rhs of the recursiveUpdate, but
148− # pass the final choice in flags using open recursion
149− # (provided with a refernece to self).
150− #
151− # NB: we can import revision, because revision.outPath is
152− # an importable path. Magic!
153− lib.recursiveUpdate (import revision (pkgArgs // { inherit hsPkgs; inherit (self) flags; })) {
154− inherit flags;
155− inherit (revision) sha256 revision revisionSha256;
156− }
157− )
158− p.packages)
159− // (lib.mapAttrs (pname: path: self:
160− import path (pkgArgs // { inherit hsPkgs; inherit (self) flags; })
161− )
162− extraDeps)
163− // (builtins.foldl' (acc: x: acc // { "${x}" = null; }) {} nonReinstallables)
164− ;
165− };
166−
167− hsPkgs = with haskellLib; weakCallPackage pkgs driver {
168− inherit haskellLib ghc weakCallPackage plan;
169− };
170−}))
nix/compat-driver.nixdeleted−13
@@ -1,13 +0,0 @@
1−{ pkgs, lib, haskellLib, ghc, weakCallPackage, plan }:
2−
3−lib.fix (hsPkgs: pkgs.callPackage "${pkgs.path}/pkgs/development/haskell-modules" {
4− haskellLib = pkgs.haskell.lib;
5− inherit ghc;
6− buildHaskellPackages = hsPkgs;
7− compilerConfig = _: _: lib.mapAttrs (_: _: null) (builtins.removeAttrs plan.compiler.packages ["ghc"]);
8− initialPackages = args: self:
9− lib.mapAttrs
10− (_: pkg: self.callPackage ../compat/driver.nix { expr = lib.fix pkg; inherit lib; })
11− (plan.packages self);
12− packageSetConfig = plan.overlay pkgs;
13−})
nix/component-driver.nixdeleted−11
@@ -1,11 +0,0 @@
1−{ pkgs, lib, haskellLib, ghc, weakCallPackage, plan }:
2−let
3− new-builder = weakCallPackage pkgs ../builder {
4− inherit haskellLib ghc weakCallPackage;
5− };
6−in
7−lib.fix (self:
8− { buildPackages = self; }
9− // lib.mapAttrs (_: _: null) plan.compiler.packages
10− // lib.mapAttrs (_: pkg: if pkg == null then null else new-builder (lib.fix pkg)) (plan.packages self)
11−)