diff options
author | Ben Sima <ben@bsima.me> | 2020-07-25 22:24:44 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-07-25 23:25:05 -0700 |
commit | 01bda0f0aa87c34a30253ffd1d5b60b33644f6d8 (patch) | |
tree | 8d2ac795680b8379c44bfe7f4817753482b3b961 /nix | |
parent | 2f32da5812583c6675bdc9ff88a3a3d5cefbb82f (diff) |
bild: support incremental compilation
Closes https://github.com/bsima/biz/issues/9
Diffstat (limited to 'nix')
-rw-r--r-- | nix/build.nix | 15 | ||||
-rw-r--r-- | nix/haskell-deps.nix | 2 | ||||
-rw-r--r-- | nix/haskell-overlay.nix | 2 | ||||
-rw-r--r-- | nix/shellHook.sh | 25 | ||||
-rw-r--r-- | nix/sources.json | 14 |
5 files changed, 46 insertions, 12 deletions
diff --git a/nix/build.nix b/nix/build.nix index fa7dcc8..5258313 100644 --- a/nix/build.nix +++ b/nix/build.nix @@ -97,8 +97,19 @@ in { name = "bizdev"; buildInputs = [ (ghc_ allDeps) - # this says something about missing haskelline? - #(ghcjs_ allDeps) + # ghcjs doesn't need everything, and many things fail to build + (ghcjs_ [ + "aeson" + "clay" + "containers" + "miso" + "protolude" + "servant" + "split" + "string-quote" + "text" + "ghcjs-base" + ]) nixpkgs.figlet nixpkgs.hlint diff --git a/nix/haskell-deps.nix b/nix/haskell-deps.nix index 26981dc..1f09b4a 100644 --- a/nix/haskell-deps.nix +++ b/nix/haskell-deps.nix @@ -9,7 +9,6 @@ "clay" "config-ini" "containers" - "dhall" "directory" "ekg" "envy" @@ -29,6 +28,7 @@ "protolude" "quickcheck-instances" "random" + "regex-applicative" "req" "safecopy" "scotty" diff --git a/nix/haskell-overlay.nix b/nix/haskell-overlay.nix index 3c7ec76..a6aad12 100644 --- a/nix/haskell-overlay.nix +++ b/nix/haskell-overlay.nix @@ -23,6 +23,7 @@ in ghcjs = pkgs.haskell.packages.ghcjs.override (old: { overrides = with pkgs.haskell.lib; self: super: pkgs.overridePinnedDeps (simpleCabalBuilder self) // { + Glob = dontCheck super.Glob; QuickCheck = dontCheck super.QuickCheck; base-compat-batteries = dontCheck super.http-types; clay = dontCheck super.clay; @@ -32,6 +33,7 @@ in network-uri= dontCheck super.network-uri; scientific = dontCheck super.scientific; # takes forever servant = dontCheck super.servant; + servant-auth = buildCabal self "servant-auth" "servant-auth"; tasty-quickcheck = dontCheck super.tasty-quickcheck; time-compat = dontCheck super.time-compat; }; diff --git a/nix/shellHook.sh b/nix/shellHook.sh index 035c450..981f86e 100644 --- a/nix/shellHook.sh +++ b/nix/shellHook.sh @@ -20,20 +20,27 @@ function deps() { niv --sources-file $BIZ_ROOT/nix/sources.json $@ } -function ghci() { - ghci -i$BIZ_ROOT -ghci-script "$BIZ_ROOT/.ghci" -} +alias ghci="ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci" function hero() { - out="_bild/nix" export HERO_PORT=3000 - export HERO_NODE=$BIZ_ROOT/$out/Hero.Node/static export HERO_KEEP=$BIZ_ROOT/_keep export HERO_SKEY=$BIZ_ROOT/_skey - b="runghc Biz.Bild" - rg --files \ - | entr -rcs \ - "$b Hero.Host && $b Hero.Node && $out/Hero.Host/bin/mmc" + bild="runghc Biz.Bild" + if [[ -z "${IN_NIX_SHELL}" ]] + then + out="_bild/dev" + export HERO_NODE=$BIZ_ROOT/$out/static/mmc.js/all.js + rg --files \ + | entr -rcs \ + "$bild Hero.Host && $bild Hero.Node && $out/bin/mmc" + else + out="_bild/nix" + export HERO_NODE=$BIZ_ROOT/$out/Hero.Node/static + rg --files \ + | entr -rcs \ + "$bild Hero.Host && $bild Hero.Node && $out/Hero.Host/bin/mmc" + fi } function lint() { diff --git a/nix/sources.json b/nix/sources.json index fdbb4b6..d2565a7 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -62,6 +62,20 @@ "url": "https://github.com/NixOS/nixpkgs/archive/b0c285807d6a9f1b7562ec417c24fa1a30ecc31a.tar.gz", "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" }, + "regex-applicative": { + "branch": "master", + "description": "Regex-based parsing with applicative interface", + "homepage": "", + "owner": "feuerbach", + "repo": "regex-applicative", + "rev": "449519c38e65753345e9a008362c011cb7a0a4d9", + "revision": "449519c38e65753345e9a008362c011cb7a0a4d9", + "sha256": "1vdrhsjzij5dm7rn10sic5dv9574yb0lyhzfv9psh7b08dsj8g1k", + "type": "tarball", + "url": "https://github.com/feuerbach/regex-applicative/archive/449519c38e65753345e9a008362c011cb7a0a4d9.tar.gz", + "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz", + "version": "0.3.4" + }, "servant-auth": { "branch": "master", "description": null, |