diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..195dbec --- /dev/null +++ b/LICENSE @@ -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. diff --git a/env.nix b/env.nix index dc9b297..b05939e 100644 --- a/env.nix +++ b/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 diff --git a/notebooks/test.ipynb b/notebooks/test.ipynb deleted file mode 100644 index 3d7cd46..0000000 --- a/notebooks/test.ipynb +++ /dev/null @@ -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 -} diff --git a/shell.nix b/shell.nix index 2eada52..07abcda 100644 --- a/shell.nix +++ b/shell.nix @@ -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