Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions dynamic.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define a development shell for dynamically linked applications (default)
{ self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true, withIOGFull ? false }:
{ self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true, withIOGFull ? false, withGHCTooling ? false }:
let tool-version-map = import ./tool-map.nix;
tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule];
cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal;
Expand Down Expand Up @@ -64,6 +64,7 @@ pkgs.mkShell {
+ lib.optionalString (!withHLS && !withHlint) "-minimal"
+ lib.optionalString withIOG "-iog"
+ lib.optionalString withIOGFull "-full"
+ lib.optionalString withGHCTooling "-ghc"
;
in ''
export PS1="\[\033[01;33m\][\w]$\[\033[00m\] "
Expand All @@ -81,6 +82,14 @@ pkgs.mkShell {
+ lib.optionalString stdenv.hostPlatform.isMacOS
''
export DYLD_LIBRARY_PATH="${lib.getLib openssl}/lib"
''
+ lib.optionalString withGHCTooling ''
export HADRIAN_CONFIGURE_FLAGS=--with-gmp-includes="${lib.getDev gmp}/include" --with-gmp-libraries="${lib.getLib gmp}/lib"
echo "HADRIAN_CONFIGURE_FLAGS set to $HADRIAN_CONFIGURE_FLAGS"
echo "To build GHC, run"
echo " ./boot"
echo " ./configure \"$HADRIAN_CONFIGURE_FLAGS\""
echo " ./hadrian/build -j"
'';

buildInputs =
Expand Down Expand Up @@ -118,7 +127,11 @@ pkgs.mkShell {
[ postgresql ] ++ (optional stdenv.hostPlatform.isAarch64 R)
)
++ attrValues haskell-tools
);
)
++ optionals withGHCTooling (
with pkgs; [ python3 automake autoconf alex happy ]
)
;

passthru = {
plans = if haskell-tools == {} then {} else
Expand Down
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
pkgs.lib.nameValuePair "${short-name}-minimal" (
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = false; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-minimal-ghc" (
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = false; withGHCTooling = true; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static" (
import ./static.nix (args // { withIOG = false; })
Expand Down
Loading