From d480cce48d04d5e4353281f014f66fd61301c393 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 15 Feb 2020 23:03:40 -0800 Subject: Split buildHaskellApp into buildGhc and buildGhcjs Two functions makes it simpler to reason about what is being built and when, even if it is a bit more explicit. I also removed the dumb Apex/Aero naming thing because Server/Client is just easier to remember. --- default.nix | 55 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 18 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index a05d370..4d2fbd2 100644 --- a/default.nix +++ b/default.nix @@ -5,7 +5,8 @@ let # TODO(bsima): buildNixOS should be split into multiple functions that each # return one thing, instead of a single function that returns multiple things buildOS = import ./Com/Simatime/buildOS.nix nixos; - buildHaskellApp = import ./Com/Simatime/buildHaskellApp.nix nixpkgs; + buildGhc = import ./Com/Simatime/buildGhc.nix nixpkgs; + buildGhcjs = import ./Com/Simatime/buildGhcjs.nix nixpkgs; nixos-mailserver = let ver = "v2.3.0"; in builtins.fetchTarball { url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/${ver}/nixos-mailserver-${ver}.tar.gz"; sha256 = "0lpz08qviccvpfws2nm83n7m2r8add2wvfg9bljx9yxx8107r919"; @@ -69,18 +70,16 @@ in { boot.isContainer = true; networking.useDHCP = false; }; - } // (buildHaskellApp { - name = "Com.InfluencedByBooks"; - nick = "ibb"; - deps = { - both = [ + } // { + Server = buildGhc { + name = "Com.InfluencedByBooks.Server"; + nick = "ibb"; + deps = [ "clay" "miso" "protolude" "servant" "text" - ]; - apex = [ "MonadRandom" "acid-state" "blaze-html" @@ -93,18 +92,27 @@ in { "servant-server" "text" ]; - aero = [ + }; + Client = buildGhcjs { + name = "Com.InfluencedByBooks.Client"; + nick = "ibb"; + deps = [ + "clay" + "miso" + "protolude" + "servant" + "text" "aeson" "containers" "ghcjs-base" ]; }; - }); - Com.MusicMeetsComics = buildHaskellApp { - name = "Com.MusicMeetsComics"; - nick = "mmc"; - deps = { - both = [ + }; + Com.MusicMeetsComics = { + Server = buildGhc { + name = "Com.MusicMeetsComics.Server"; + nick = "mmc"; + deps = [ "aeson" "clay" "containers" @@ -114,8 +122,6 @@ in { "split" "string-quote" "text" - ]; - apex = [ "dhall" "ekg" "fast-logger" @@ -136,7 +142,20 @@ in { "wai-middleware-metrics" "warp" ]; - aero = [ + }; + Client = buildGhcjs { + name = "Com.MusicMeetsComics.Client"; + nick = "mmc"; + deps = [ + "aeson" + "clay" + "containers" + "miso" + "protolude" + "servant" + "split" + "string-quote" + "text" "ghcjs-base" ]; }; -- cgit v1.2.3