{ pkgs ? import sources.nixpkgs { overlays = [ (import "${sources.acms}/pkgs" { }) (import ./pkgs { }) (self: super: { haskell = super.haskell // { packageOverrides = self.lib.composeManyExtensions [ super.haskell.packageOverrides (self: super: { ghcWithPackages = super.ghcWithPackages.override { installDocumentation = false; # XXX true (default) }; }) ]; }; }) ]; } , sources ? import ./nix/sources.nix }: let ghc = "ghc910"; in rec { frontend = pkgs.pkgsCross.ghcjs.haskell.packages.${ghc}.achat; backend = pkgs.haskell.packages.${ghc}.achat; shell = pkgs.mkShell { inputsFrom = [ (pkgs.pkgsCross.ghcjs.haskell.packages.${ghc}.shellFor { packages = haskellPackages: [ haskellPackages.achat ]; }) (pkgs.haskell.packages.${ghc}.shellFor { packages = haskellPackages: [ haskellPackages.achat ]; }) (pkgs.mkShell { buildInputs = [ pkgs.haskell.packages.${ghc}.cabal-install pkgs.haskell.packages.${ghc}.ormolu pkgs.python3 (pkgs.writers.writeDashBin "build-frontend" '' set -efu cabal \ --with-compiler=javascript-unknown-ghcjs-ghc \ --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 '') (pkgs.writers.writeDashBin "build" '' set -efu build-frontend build-backend '') ]; shellHook = '' export EM_CACHE="${toString ./.}/.emcache" # nixos/nixpkgs#282509 ''; }) ]; }; }