Skip to content

Commit 7c56d2b

Browse files
committed
Just set a default src in modules/hackage-project.nix
1 parent fdfae24 commit 7c56d2b

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

compiler/ghc/default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ let
290290
cd hadrian
291291
'';
292292
}];
293-
cabalProject = builtins.readFile (src + "/hadrian/cabal.project");
294293
cabalProjectLocal = null;
295294
cabalProjectFreeze = null;
296295
src = haskell-nix.haskellLib.cleanSourceWith {

modules/hackage-project.nix

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ lib, config, pkgs, haskellLib, ... }:
22
let
3-
inherit (config) name version revision;
3+
inherit (config) name version;
4+
fullName = name + lib.optionalString (version != "latest") "-${version}";
45
in {
56
_file = "haskell.nix/modules/hackage-project.nix";
67
options = {
@@ -11,9 +12,14 @@ in {
1112
};
1213
};
1314
config = {
14-
cabalProject = ''
15-
extra-packages: ${config.name}${lib.optionalString (config.version != "latest") "-${config.version}"}
16-
'';
17-
src = lib.mkDefault { outPath = pkgs.pkgsBuildBuild.runCommand "empty" {} "mkdir $out; touch $out/.not-completely-empty"; filterPath = { path, ... }: path; };
15+
src = lib.mkDefault {
16+
outPath =
17+
pkgs.pkgsBuildBuild.runCommand "from-hackage-${fullName}" {} ''
18+
mkdir $out
19+
echo "extra-packages: ${fullName}" > $out/cabal.project
20+
'';
21+
# Disable git cleanSourceWith filtering
22+
filterPath = { path, ... }: path;
23+
};
1824
};
1925
}

0 commit comments

Comments
 (0)