|
62 | 62 | };
|
63 | 63 | stackage = import stackageSrc;
|
64 | 64 |
|
65 |
| - packages = self: ({ |
| 65 | + packages = pkgs: self: (rec { |
| 66 | + inherit pkgs; # Make pkgs available (it is the underlying nixpkgs) |
| 67 | + |
| 68 | + # Packages built to run on the build platform, not the host platform |
| 69 | + buildPackages = pkgs.buildPackages.lib.makeScope pkgs.buildPackages.newScope |
| 70 | + (packages pkgs.buildPackages); |
| 71 | + |
66 | 72 | # Utility functions for working with the component builder.
|
67 | 73 | haskellLib = let hl = import ./lib { inherit (pkgs) lib; haskellLib = hl; }; in hl;
|
68 | 74 |
|
@@ -123,15 +129,16 @@ let
|
123 | 129 | # Programs for generating Nix expressions from Cabal and Stack
|
124 | 130 | # files. We need to make sure we build this from the buildPackages,
|
125 | 131 | # we never want to actually cross compile nix-tools on it's own.
|
126 |
| - nix-tools = pkgs.buildPackages.callPackage ./nix-tools { |
| 132 | + nix-tools-cross-compiled = pkgs.callPackage ./nix-tools { |
127 | 133 | inherit fetchExternal cleanSourceHaskell;
|
128 |
| - hpack = pkgs.buildPackages.haskell.lib.justStaticExecutables |
129 |
| - (pkgs.buildPackages.haskellPackages.hpack); |
| 134 | + hpack = pkgs.haskell.lib.justStaticExecutables |
| 135 | + (pkgs.haskellPackages.hpack); |
130 | 136 | inherit (self) mkCabalProjectPkgSet;
|
131 | 137 | };
|
| 138 | + nix-tools = buildPackages.nix-tools-cross-compiled; |
132 | 139 |
|
133 | 140 | # Function to call stackToNix
|
134 |
| - callStackToNix = self.callPackage ./call-stack-to-nix.nix {}; |
| 141 | + callStackToNix = buildPackages.callPackage ./call-stack-to-nix.nix {}; |
135 | 142 |
|
136 | 143 | # Snapshots of Hackage and Stackage, converted to Nix expressions,
|
137 | 144 | # regularly updated.
|
@@ -180,11 +187,11 @@ let
|
180 | 187 | # Resulting nix files are added to nix-plan subdirectory.
|
181 | 188 | callCabalProjectToNix = import ./lib/cabalProjectToNix.nix {
|
182 | 189 | index-state-hashes = import indexStateHashesPath;
|
183 |
| - inherit (self) dotCabal; |
184 |
| - inherit pkgs; |
185 |
| - inherit (pkgs) runCommand cabal-install ghc symlinkJoin cacert; |
186 |
| - inherit (pkgs.haskellPackages) hpack; |
187 |
| - inherit (self) nix-tools; |
| 190 | + inherit (buildPackages) dotCabal; |
| 191 | + pkgs = buildPackages.pkgs; # buildPackages; |
| 192 | + inherit (buildPackages.pkgs.haskellPackages) hpack; |
| 193 | + inherit (buildPackages.pkgs) runCommand cabal-install ghc symlinkJoin cacert; |
| 194 | + inherit (buildPackages) nix-tools; |
188 | 195 | };
|
189 | 196 |
|
190 | 197 | # References to the unpacked sources, for caching in a Hydra jobset.
|
|
194 | 201 | });
|
195 | 202 |
|
196 | 203 | in
|
197 |
| - pkgs.lib.makeScope pkgs.newScope packages |
| 204 | + pkgs.lib.makeScope pkgs.newScope (packages pkgs) |
0 commit comments