Created
June 1, 2015 04:21
-
-
Save sheganinans/9ebe6b940c44baffedcc to your computer and use it in GitHub Desktop.
A mini isomorphic Haskell webdev environment
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
{ pkgs ? import <nixpkgs> {}, repo ? import <repo> {} }: # Make sure <repo> is defined in your | |
let # $NIX_PATH and pointing to a clone of: | |
# github.com/NixOS/nixpkgs | |
stdenv = pkgs.stdenv; | |
ghcp = repo.haskell-ng.packages; | |
ghc710 = ghcp.ghc7101; | |
ghcjs = ghcp.ghcjs; | |
hsEnv = ghc710.ghcWithPackages (hs: with hs; ([ | |
# Server side deps go here | |
] ++ hsIso )); | |
hsJsEnv = ghcjs.ghcWithPackages (hs: with hs; ([ | |
# Client side deps go here | |
] ++ hsIso )); | |
hsIso = with ghc710; with ghcjs; [ | |
# Isomorphic deps go here | |
]; | |
in rec { | |
app = stdenv.mkDerivation { | |
name = "app"; | |
src = ./.; | |
buildInputs = with pkgs; [ | |
hsEnv | |
hsJsEnv | |
]; | |
PORT = "8888"; | |
installPhase = '' | |
# install steps go here | |
''; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment