Skip to content

Commit 4135f9d

Browse files
committed
Fixup
1 parent 9534fbe commit 4135f9d

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

call-stack-to-nix.nix

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
/* The function obtained when this is applied to a package set calls
2-
* the stack-to-nix tool on a supplied source set and then
1+
/* The function obtained when this is applied to a package set calls
2+
* the stack-to-nix tool on a supplied source set and then
33
* imports the resulting pkgs.nix. The application of this function
44
* to a source path can thus be used directly as the input to mkStackPackageSet
5-
*/
6-
{ nix-tools, pkgs }: { src, stackYaml ? null }:
5+
*/
6+
{ nix-tools, pkgs }:
7+
{ src, stackYaml ? null }:
78
let
89
pkgsNix = pkgs.stdenv.mkDerivation {
910
name = "pkgs-nix";
1011
inherit src;
11-
nativeBuildInputs = [ nix-tools pkgs.nix-prefetch-git pkgs.rsync ];
12+
nativeBuildInputs = [ nix-tools pkgs.nix-prefetch-git ];
1213
installPhase = ''
1314
export LANG=C.utf8 # Needed or stack-to-nix will die on unicode inputs
1415
mkdir -p $out

default.nix

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,7 @@ let
5252
override = "stackage";
5353
});
5454

55-
packages = pkgs: self: (rec {
56-
inherit pkgs; # Make pkgs available via callPackage
57-
58-
# Packages built to run on the build platform, not the host platform
59-
buildPackages = pkgs.buildPackages.lib.makeScope pkgs.buildPackages.newScope (packages pkgs.buildPackages);
60-
55+
packages = self: ({
6156
# Utility functions for working with the component builder.
6257
haskellLib = let hl = import ./lib { inherit (pkgs) lib; haskellLib = hl; }; in hl;
6358

@@ -111,11 +106,12 @@ let
111106
};
112107

113108
# Programs for generating Nix expressions from Cabal and Stack
114-
# files.
115-
nix-tools = self.callPackage ./nix-tools { inherit fetchExternal; };
109+
# files. We need to make sure we build this from the buildPackages,
110+
# we never want to actually cross compile nix-tools on it's own.
111+
nix-tools = pkgs.buildPackages.callPackage ./nix-tools { inherit fetchExternal; inherit (self) mkCabalProjectPkgSet; };
116112

117113
# Function to call stackToNix
118-
callStackToNix = buildPackages.callPackage ./call-stack-to-nix.nix {};
114+
callStackToNix = self.callPackage ./call-stack-to-nix.nix {};
119115

120116
# Snapshots of Hackage and Stackage, converted to Nix expressions,
121117
# regularly updated.
@@ -130,4 +126,4 @@ let
130126
});
131127

132128
in
133-
pkgs.lib.makeScope pkgs.newScope (packages pkgs)
129+
pkgs.lib.makeScope pkgs.newScope packages

test/tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rm -rvf */cabal.project.local */.ghc.environment* */dist */dist-newstyle */.stac
1212
echo >& 2
1313

1414
printf "*** Running the nix-build tests...\n" >& 2
15-
nix-build $NIX_BUILD_ARGS --no-out-link --keep-going ./default.nix
15+
nix build $NIX_BUILD_ARGS --no-link --keep-going -f ./default.nix
1616
echo >& 2
1717

1818
printf "*** Running the unit tests... " >& 2

0 commit comments

Comments
 (0)