-
Notifications
You must be signed in to change notification settings - Fork 1
/
shell.nix
47 lines (36 loc) · 1.4 KB
/
shell.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
38
39
40
41
42
43
44
45
46
47
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
let
inherit (nixpkgs) pkgs;
inherit (pkgs.haskell) lib stdenv;
overrides =
if builtins.pathExists ./overrides.nix
then import ./overrides.nix pkgs pkgs.haskell.lib
else self: super: {};
haskellPackages =
if compiler == "default"
then pkgs.haskellPackages.override { inherit overrides; }
else pkgs.haskell.packages.${compiler}.override { inherit overrides; };
drv = lib.overrideCabal (haskellPackages.callPackage ./. {}) (args: {
src =
let
omitted = [ ".git" "dist" "nixpkgs" ];
isOmitted = path: stdenv.lib.elem (baseNameOf path) omitted;
pred = path: type: type != "directory" || !(isOmitted path);
in
builtins.filterSource pred args.src;
shellHook = with pkgs.rPackages; ''
R_LIBS_SITE=
rPackages=
findInputs ${ggplot2} rPackages propagated-native-build-inputs
findInputs ${gridExtra} rPackages propagated-native-build-inputs
findInputs ${plotly} rPackages propagated-native-build-inputs
findInputs ${rgl} rPackages propagated-native-build-inputs
for p in $rPackages; do
R_LIBS_SITE="$R_LIBS_SITE''${R_LIBS_SITE:+:}$p/library"
done
export R_LIBS_SITE
'';
librarySystemDepends = (args.librarySystemDepends or []) ++ [ pkgs.R ];
});
in
if pkgs.lib.inNixShell then drv.env else drv