Skip to content

Instantly share code, notes, and snippets.

@wavewave
Created March 29, 2018 20:43
Show Gist options
  • Select an option

  • Save wavewave/ed5eb2299704e4a1bc22df36d156abbc to your computer and use it in GitHub Desktop.

Select an option

Save wavewave/ed5eb2299704e4a1bc22df36d156abbc to your computer and use it in GitHub Desktop.
ihaskell-inline-r setup
#
# To run,
# $ nix-shell ihaskell.nix --argstr ihaskellpath (IHaskell directory)
#
# inside the shell, run
# $ ihaskell-notebook
#
{ ihaskellpath }:
let pkgs = import <nixpkgs> {};
in
with pkgs;
let
rwrapper = rWrapper.override {
packages = [ rPackages.ggplot2 ];
};
ihaskell = import (ihaskellpath + "/release.nix") {
packages = haskellPackages: [
haskellPackages.lens
haskellPackages.ihaskell-diagrams
haskellPackages.ihaskell-charts
haskellPackages.ihaskell-blaze
haskellPackages.ihaskell-inline-r
haskellPackages.static-canvas
];
systemPackages = pkgs: [ rwrapper ];
};
in
stdenv.mkDerivation {
name = "ihaskell-env";
buildInputs = [
ihaskell
rwrapper
];
shellHook = ''
export R_LIBS_SITE=$(R -e "cat(Sys.getenv(\"R_LIBS_SITE\"))" --quiet --slave)
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment