Skip to content

Commit 49eb327

Browse files
committed
shellFor: provide CABAL_CONFIG in shell
1 parent 4ecc0aa commit 49eb327

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

builder/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ in {
3030
# Same as haskellPackages.shellFor in nixpkgs.
3131
shellFor = haskellLib.weakCallPackage pkgs ./shell-for.nix {
3232
inherit hsPkgs ghcForComponent makeConfigFiles;
33+
inherit (buildPackages) glibcLocales;
3334
};
3435
}

builder/shell-for.nix

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ buildPackages, lib, stdenv, ghcForComponent, makeConfigFiles, hsPkgs }:
1+
{ lib, stdenv, glibcLocales, ghcForComponent, makeConfigFiles, hsPkgs }:
22

33
{ packages, withHoogle ? true, ... } @ args:
44

@@ -7,18 +7,19 @@ let
77
name = if lib.length selected == 1
88
then "ghc-shell-for-${(lib.head selected).name}"
99
else "ghc-shell-for-packages";
10+
configFiles = makeConfigFiles {
11+
fullName = args.name or name;
12+
identifier.name = name;
13+
component = {
14+
depends = selected;
15+
libs = [];
16+
frameworks = [];
17+
doExactConfig = false;
18+
};
19+
};
1020
ghcEnv = ghcForComponent {
1121
componentName = name;
12-
configFiles = makeConfigFiles {
13-
fullName = args.name or name;
14-
identifier.name = name;
15-
component = {
16-
depends = selected;
17-
libs = [];
18-
frameworks = [];
19-
doExactConfig = false;
20-
};
21-
};
22+
inherit configFiles;
2223
};
2324
mkDrvArgs = builtins.removeAttrs args ["packages" "withHoogle"];
2425

@@ -34,7 +35,8 @@ in
3435
phases = ["installPhase"];
3536
installPhase = "echo $nativeBuildInputs $buildInputs > $out";
3637
LANG = "en_US.UTF-8";
37-
LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive";
38+
LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
39+
CABAL_CONFIG = "${configFiles}/cabal.config";
3840

3941
passthru.ghc = ghcEnv;
4042
})

0 commit comments

Comments
 (0)