diff options
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 78 |
1 files changed, 50 insertions, 28 deletions
diff --git a/default.nix b/default.nix index c6cbdbd..7daa1a8 100644 --- a/default.nix +++ b/default.nix @@ -1,42 +1,64 @@ { pkgs ? import sources.nixpkgs { overlays = [ - (import ./pkgs { inherit (pkgs.haskell) lib; }) + (import "${sources.acms}/pkgs" { }) + (import ./pkgs { }) (self: super: { haskell = super.haskell // { - packageOverrides = self.lib.composeManyExtensions - [ - (super.haskell.packageOverrides or (self: super: self)) - (self: super: { - ghcWithPackages = super.ghcWithPackages.override { - installDocumentation = false; # XXX true (default) - }; - }) - ]; + 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"; - haskellPackages = pkgs.pkgsCross.ghcjs.haskell.packages.${ghc}; - acms = (import sources.acms { }).acms; -in +let ghc = "ghc910"; in rec { - inherit haskellPackages; - inherit (haskellPackages) achat; - shell = haskellPackages.shellFor { - packages = _: [ - haskellPackages.achat - ]; - nativeBuildInputs = [ - acms - pkgs.haskell.packages.${ghc}.cabal-install - pkgs.haskell.packages.${ghc}.ormolu + 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.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 "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 + ''; + }) ]; - shellHook = '' - export EM_CACHE="${toString ./.}/.emcache" # nixos/nixpkgs#282509 - ''; }; } |