summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.gitlab/ci.sh8
-rw-r--r--.gitlab/shell.nix9
2 files changed, 8 insertions, 9 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 99c7e8bfa5..2e0118bf2f 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -176,13 +176,7 @@ function set_toolchain_paths() {
*) ;;
esac
- if [[ -n "${IN_NIX_SHELL:-}" ]]; then
- needs_toolchain=""
- GHC="$(which ghc)"
- CABAL="$(which cabal)"
- HAPPY="$(which happy)"
- ALEX="$(which alex)"
- elif [[ -n "$needs_toolchain" ]]; then
+ if [[ -n "$needs_toolchain" ]]; then
# These are populated by setup_toolchain
GHC="$toolchain/bin/ghc$exe"
CABAL="$toolchain/bin/cabal$exe"
diff --git a/.gitlab/shell.nix b/.gitlab/shell.nix
index 5e32847735..37e6585879 100644
--- a/.gitlab/shell.nix
+++ b/.gitlab/shell.nix
@@ -18,11 +18,16 @@
#
# nix has the ugly habbit of duplicating ld flags more than necessary. This
# somewhat consolidates this.
- shellHook = ''
+ shellHook = (with pkgs.haskell; ''
export NIX_LDFLAGS=$(for a in $NIX_LDFLAGS; do echo $a; done |sort|uniq|xargs)
export NIX_LDFLAGS_FOR_TARGET=$(for a in $NIX_LDFLAGS_FOR_TARGET; do echo $a; done |sort|uniq|xargs)
export NIX_LDFLAGS_FOR_TARGET=$(comm -3 <(for l in $NIX_LDFLAGS_FOR_TARGET; do echo $l; done) <(for l in $NIX_LDFLAGS; do echo $l; done))
- '';
+
+ export GHC=${compiler.${compiler}}/bin/ghc
+ export ALEX=${packages.${compiler}.alex}/bin/alex
+ export HAPPY=${packages.${compiler}.happy}/bin/happy
+ export CABAL=${packages.${compiler}.cabal-install}/bin/cabal
+ '');
nativeBuildInputs = (with pkgs; [
haskell.compiler.${compiler}