-
Notifications
You must be signed in to change notification settings - Fork 30
/
nixpkgs.nix
37 lines (34 loc) · 1.31 KB
/
nixpkgs.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Trying to workaround
# https://github.com/NixOS/nixpkgs/issues/105573
#
# by going to a commit before the one introducing the regression.
args:
let pkgs = import (fetchTarball "https://github.com/tweag/nixpkgs/archive/73ad5f9e147.tar.gz") args;
spark = pkgs.spark2.override {
# TODO: Some part/dependency of spark is unable to cope with newer
# jdks. The apps/rdd-ops example would fail. Needs further investigation.
jdk8 = pkgs.openjdk8;
# hadoop_2_8 allows spark to access s3 resources anonymously
hadoop = pkgs.hadoop2;
};
stack_ignore_global_hints = pkgs.writeScriptBin "stack" ''
#!${pkgs.stdenv.shell}
# Skips the --global-hints parameter to stack. This is
# necessary when using an unreleased compiler whose hints
# aren't available yet.
set -euo pipefail
declare -a args
for a in "''$@"
do
if [[ "$a" != "--global-hints" ]]
then
args+=("$a")
fi
done
# Passing --no-nix is necessary on nixos to stop stack from
# looking for nixpkgs.
# --system-ghc is also necessary to pick the unreleased compiler
# from the PATH.
exec ${pkgs.stack}/bin/stack --no-nix --system-ghc ''${args[@]}
'';
in pkgs // { inherit stack_ignore_global_hints; inherit spark; }