From eece8755d1f5da1a5be319edf37c1a6244289010 Mon Sep 17 00:00:00 2001 From: Vaibhav Sagar Date: Mon, 6 Nov 2017 14:29:56 +0800 Subject: [PATCH] ihaskell: re-enable --- nixos/modules/misc/ids.nix | 4 ++-- nixos/modules/module-list.nix | 2 +- .../tools/haskell/ihaskell/wrapper.nix | 23 ++++++++++--------- pkgs/top-level/all-packages.nix | 12 ++++------ 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index beb91a7c150d..7d0cbf6aad02 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -207,7 +207,7 @@ ripple-data-api = 186; mediatomb = 187; rdnssd = 188; - # ihaskell = 189; # unused + ihaskell = 189; i2p = 190; lambdabot = 191; asterisk = 192; @@ -484,7 +484,7 @@ #ripple-data-api = 186; #unused mediatomb = 187; #rdnssd = 188; # unused - # ihaskell = 189; # unused + ihaskell = 189; i2p = 190; lambdabot = 191; asterisk = 192; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 521e2c0ca241..99d3c0112f2a 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -304,7 +304,7 @@ ./services/misc/gogs.nix ./services/misc/gollum.nix ./services/misc/gpsd.nix - #./services/misc/ihaskell.nix + ./services/misc/ihaskell.nix ./services/misc/irkerd.nix ./services/misc/jackett.nix ./services/misc/logkeys.nix diff --git a/pkgs/development/tools/haskell/ihaskell/wrapper.nix b/pkgs/development/tools/haskell/ihaskell/wrapper.nix index f1a4f219682d..75ad33e72f63 100644 --- a/pkgs/development/tools/haskell/ihaskell/wrapper.nix +++ b/pkgs/development/tools/haskell/ihaskell/wrapper.nix @@ -1,27 +1,28 @@ -{ stdenv, writeScriptBin, makeWrapper, buildEnv, ghcWithPackages, ihaskell, ipython, packages }: +{ stdenv, writeScriptBin, makeWrapper, buildEnv, haskell, ghcWithPackages, ihaskell, jupyter, packages }: let ihaskellEnv = ghcWithPackages (self: [ self.ihaskell - self.ihaskell-blaze - self.ihaskell-diagrams - self.ihaskell-display + (haskell.lib.doJailbreak self.ihaskell-blaze) + (haskell.lib.doJailbreak self.ihaskell-diagrams) + (haskell.lib.doJailbreak self.ihaskell-display) ] ++ packages self); ihaskellSh = writeScriptBin "ihaskell-notebook" '' #! ${stdenv.shell} export GHC_PACKAGE_PATH="$(echo ${ihaskellEnv}/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH" - export PATH="${stdenv.lib.makeBinPath [ ihaskell ihaskellEnv ipython ]}" - ${ihaskell}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) && ${ipython}/bin/ipython notebook --kernel=haskell + export PATH="${stdenv.lib.makeBinPath ([ ihaskell ihaskellEnv jupyter ])}" + ${ihaskell}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) && ${jupyter}/bin/jupyter notebook ''; - profile = "${ihaskell.pname}-${ihaskell.version}/profile/profile.tar"; in buildEnv { name = "ihaskell-with-packages"; - paths = [ ihaskellEnv ipython ]; + buildInputs = [ makeWrapper ]; + paths = [ ihaskellEnv jupyter ]; postBuild = '' - . "${makeWrapper}/nix-support/setup-hook" - ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/. + ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/ for prg in $out/bin"/"*;do - wrapProgram $prg --set PYTHONPATH "$(echo ${ipython}/lib/*/site-packages)" + if [[ -f $prg && -x $prg ]]; then + wrapProgram $prg --set PYTHONPATH "$(echo ${jupyter}/lib/*/site-packages)" + fi done ''; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d58ecda7135c..ebb9831d3ff0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2684,15 +2684,13 @@ with pkgs; }; - # ihaskell = callPackage ../development/tools/haskell/ihaskell/wrapper.nix { - # inherit (haskellPackages) ihaskell ghcWithPackages; + ihaskell = callPackage ../development/tools/haskell/ihaskell/wrapper.nix { + inherit (haskellPackages) ihaskell ghcWithPackages; - # ipython = python3.buildEnv.override { - # extraLibs = with python3Packages; [ ipython ipykernel jupyter_client notebook ]; - # }; + jupyter = python3.withPackages (ps: [ ps.jupyter ps.notebook ]); - # packages = config.ihaskell.packages or (self: []); - # }; + packages = config.ihaskell.packages or (self: []); + }; imapproxy = callPackage ../tools/networking/imapproxy { };