mirror of
https://github.com/vale981/nix-jupyter-env
synced 2025-03-04 09:21:41 -05:00
Install IHaskell in the shell hook and add some basic IHaskell packages
This commit is contained in:
parent
4ffe836dd7
commit
7bf5b9ab27
4 changed files with 64 additions and 96 deletions
20
LICENSE
Normal file
20
LICENSE
Normal file
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Rehno Lindeque
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
72
env.nix
72
env.nix
|
@ -52,7 +52,7 @@ let
|
|||
[
|
||||
jupyter
|
||||
|
||||
# Python packages (uncomment as needed)
|
||||
# Python packages (comment/uncomment as needed)
|
||||
/* scipy */
|
||||
/* toolz */
|
||||
/* numpy */
|
||||
|
@ -126,42 +126,48 @@ let
|
|||
};
|
||||
haskellPackages = pkgs.haskell.packages.${haskellCompiler}.override haskellOverrides;
|
||||
ihaskellWithPackages = packages: haskellPackages.ghcWithPackages
|
||||
(
|
||||
self:
|
||||
with self;
|
||||
[
|
||||
ihaskell
|
||||
|
||||
# IHaskell packages (uncomment as needed)
|
||||
/* ihaskell-blaze */
|
||||
/* ihaskell-diagrams */
|
||||
/* ihaskell-display */
|
||||
|
||||
# Haskell packages (uncomment as needed)
|
||||
/* opaleye */
|
||||
/* cassava */
|
||||
] ++ packages self
|
||||
);
|
||||
ihaskell-env =
|
||||
(
|
||||
self:
|
||||
with self;
|
||||
[
|
||||
ihaskell
|
||||
|
||||
# IHaskell displayables (comment/uncomment as needed)
|
||||
/* ihaskell-display */
|
||||
ihaskell-aeson
|
||||
ihaskell-basic
|
||||
ihaskell-blaze
|
||||
ihaskell-charts
|
||||
ihaskell-diagrams
|
||||
/* ihaskell-hatex */
|
||||
/* ihaskell-juicypixels */
|
||||
/* ihaskell-magic */
|
||||
/* ihaskell-plot */
|
||||
/* ihaskell-rlangqq */
|
||||
/* ihaskell-static-canvas */
|
||||
/* ihaskell-widgets */
|
||||
|
||||
# Haskell packages (comment/uncomment as needed)
|
||||
opaleye
|
||||
cassava
|
||||
] ++ packages self
|
||||
);
|
||||
ihaskell-env =
|
||||
let
|
||||
drv = ihaskellWithPackages
|
||||
(
|
||||
self:
|
||||
with self;
|
||||
[
|
||||
# Add your own haskell packages here...
|
||||
]
|
||||
);
|
||||
in
|
||||
pkgs.buildEnv
|
||||
{
|
||||
name = "ihaskell-env";
|
||||
paths =
|
||||
[
|
||||
(
|
||||
ihaskellWithPackages
|
||||
(
|
||||
self:
|
||||
with self;
|
||||
[
|
||||
# Add your own haskell packages here...
|
||||
]
|
||||
)
|
||||
)
|
||||
];
|
||||
}
|
||||
);
|
||||
paths = [ drv ];
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"{-# LANGUAGE NoImplicitPrelude #-}\n",
|
||||
"import Prelude hiding (sum)\n",
|
||||
"\n",
|
||||
"import Diagrams.Prelude\n",
|
||||
"import Opaleye\n",
|
||||
"\n",
|
||||
"testTable :: Table (Column PGText)\n",
|
||||
"testTable = Table \"test\" \n",
|
||||
" ( p2 \n",
|
||||
" ( required \"name\"\n",
|
||||
" )\n",
|
||||
" )\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"\"Test\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Haskell",
|
||||
"language": "haskell",
|
||||
"name": "haskell"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": "ihaskell",
|
||||
"file_extension": ".hs",
|
||||
"name": "haskell",
|
||||
"version": "7.10.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
let
|
||||
inherit (nixpkgs) pkgs;
|
||||
inherit (import ./env.nix { inherit nixpkgs; }) jupyter-env;
|
||||
in
|
||||
pkgs.stdenv.mkDerivation
|
||||
{
|
||||
|
@ -24,12 +25,11 @@ in
|
|||
src = ./.;
|
||||
buildInputs =
|
||||
(
|
||||
with import ./env.nix { inherit nixpkgs; };
|
||||
with pkgs;
|
||||
[
|
||||
jupyter-env
|
||||
|
||||
# Utilities (uncomment as needed)
|
||||
# Utilities (comment/uncomment as needed)
|
||||
/* cabal2nix */
|
||||
/* nixops */
|
||||
/* pythonPackages.pgcli */
|
||||
|
@ -140,6 +140,9 @@ in
|
|||
# git config filter.lhsconvert.smudge cat
|
||||
# git config filter.lhsconvert.required true
|
||||
|
||||
echo "Install ihaskell kernel..."
|
||||
${jupyter-env}/bin/ihaskell install -l $(${jupyter-env}/bin/ghc --print-libdir)
|
||||
|
||||
# echo "Run in a local environment so that we can use pip as needed..."
|
||||
# virtualenv --python=python3.4 .venv
|
||||
# source .venv/bin/activate
|
||||
|
|
Loading…
Add table
Reference in a new issue