Created
March 29, 2018 20:43
-
-
Save wavewave/ed5eb2299704e4a1bc22df36d156abbc to your computer and use it in GitHub Desktop.
ihaskell-inline-r setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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