default.nix

blankhart 2018-03-07 19:35:01.978198 UTC

1{ pkgs ? import <nixpkgs> {} }:
2let
3
4 inherit (pkgs) runCommand closurecompiler;
5
6 pkgs.haskell.packages.ghcjs = pkgs.haskell.packages.ghcjs.override {
7 overrides = self: super: {
8 miso = self.callPackage _nix/miso-ghcjs.nix { };
9 remix-shared = self.callCabal2nix "remix-shared" ./shared {};
10 remix-client = self.callCabal2nix "remix-client" ./client {};
11 };
12 };
13
14 pkgs.haskell.packages.ghc802 = pkgs.haskell.packages.ghc802.override {
15 overrides = self: super: {
16 miso = self.callPackage _nix/miso-ghc.nix { };
17 remix-shared = self.callCabal2nix "remix-shared" ./shared {};
18 remix-server = self.callCabal2nix "remix-server" ./server {};
19 };
20 };
21
22# server = ghc802.callPackage ghc802.remix-server {};
23# client = ghcjs.callPackage ghcjs.remix-client {};
24
25 client = pkgs.haskell.packages.ghcjs.remix-client;
26 server = pkgs.haskell.packages.ghc802.remix-server;
27
28in runCommand "remix-project" { inherit client server; } ''
29 mkdir -p $out/{bin,static}
30 ${closurecompiler}/bin/closure-compiler ${client}/bin/client.jsexe/all.js > $out/static/all.js
31 cp ${server}/bin/* $out/bin
32 ''