mirror of
https://github.com/vale981/nix-jupyter-env
synced 2025-03-04 17:31: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
|
jupyter
|
||||||
|
|
||||||
# Python packages (uncomment as needed)
|
# Python packages (comment/uncomment as needed)
|
||||||
/* scipy */
|
/* scipy */
|
||||||
/* toolz */
|
/* toolz */
|
||||||
/* numpy */
|
/* numpy */
|
||||||
|
@ -126,42 +126,48 @@ let
|
||||||
};
|
};
|
||||||
haskellPackages = pkgs.haskell.packages.${haskellCompiler}.override haskellOverrides;
|
haskellPackages = pkgs.haskell.packages.${haskellCompiler}.override haskellOverrides;
|
||||||
ihaskellWithPackages = packages: haskellPackages.ghcWithPackages
|
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
|
pkgs.buildEnv
|
||||||
{
|
{
|
||||||
name = "ihaskell-env";
|
name = "ihaskell-env";
|
||||||
paths =
|
paths = [ drv ];
|
||||||
[
|
};
|
||||||
(
|
|
||||||
ihaskellWithPackages
|
|
||||||
(
|
|
||||||
self:
|
|
||||||
with self;
|
|
||||||
[
|
|
||||||
# Add your own haskell packages here...
|
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
in
|
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
|
let
|
||||||
inherit (nixpkgs) pkgs;
|
inherit (nixpkgs) pkgs;
|
||||||
|
inherit (import ./env.nix { inherit nixpkgs; }) jupyter-env;
|
||||||
in
|
in
|
||||||
pkgs.stdenv.mkDerivation
|
pkgs.stdenv.mkDerivation
|
||||||
{
|
{
|
||||||
|
@ -24,12 +25,11 @@ in
|
||||||
src = ./.;
|
src = ./.;
|
||||||
buildInputs =
|
buildInputs =
|
||||||
(
|
(
|
||||||
with import ./env.nix { inherit nixpkgs; };
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
jupyter-env
|
jupyter-env
|
||||||
|
|
||||||
# Utilities (uncomment as needed)
|
# Utilities (comment/uncomment as needed)
|
||||||
/* cabal2nix */
|
/* cabal2nix */
|
||||||
/* nixops */
|
/* nixops */
|
||||||
/* pythonPackages.pgcli */
|
/* pythonPackages.pgcli */
|
||||||
|
@ -140,6 +140,9 @@ in
|
||||||
# git config filter.lhsconvert.smudge cat
|
# git config filter.lhsconvert.smudge cat
|
||||||
# git config filter.lhsconvert.required true
|
# 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..."
|
# echo "Run in a local environment so that we can use pip as needed..."
|
||||||
# virtualenv --python=python3.4 .venv
|
# virtualenv --python=python3.4 .venv
|
||||||
# source .venv/bin/activate
|
# source .venv/bin/activate
|
||||||
|
|
Loading…
Add table
Reference in a new issue