Skip to content

Instantly share code, notes, and snippets.

@sheganinans
Created June 1, 2015 04:21
Show Gist options
  • Save sheganinans/9ebe6b940c44baffedcc to your computer and use it in GitHub Desktop.
Save sheganinans/9ebe6b940c44baffedcc to your computer and use it in GitHub Desktop.
A mini isomorphic Haskell webdev environment
{ 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