aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--default.nix6
2 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index ff9541c..f95e691 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,6 @@
```console
build
acms serve content &
-python -m http.server -d dist-newstyle/build/javascript-ghcjs/ghc-9.10.1/achat-0.1.0.0/x/frontend/build/frontend/frontend.jsexe &
+serve-frontend &
firefox http://localhost:8000
```
diff --git a/default.nix b/default.nix
index 39a3bd6..f3e7e05 100644
--- a/default.nix
+++ b/default.nix
@@ -38,6 +38,7 @@ rec {
buildInputs = [
pkgs.haskell.packages.${ghc}.cabal-install
pkgs.haskell.packages.${ghc}.ormolu
+ pkgs.python3
(pkgs.writers.writeDashBin "build-frontend" ''
set -efu
cabal \
@@ -45,6 +46,10 @@ rec {
--with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg \
build
'')
+ (pkgs.writers.writeDashBin "serve-frontend" ''
+ set -efu
+ ${pkgs.python3}/bin/python -m http.server -d ${pkgs.lib.escapeShellArg (toString ./.)}dist-newstyle/build/javascript-ghcjs/ghc-9.10.1/achat-0.1.0.0/x/frontend/build/frontend/frontend.jsexe &
+ '')
(pkgs.writers.writeDashBin "build-backend" ''
set -efu
cabal build
@@ -54,7 +59,6 @@ rec {
build-frontend
build-backend
'')
- pkgs.python3
];
shellHook = ''
export EM_CACHE="${toString ./.}/.emcache" # nixos/nixpkgs#282509