Hello! I’m trying to add servant-ghcjs-client to my Haskell project. This package is not in Hackage, but it is within the servant git repo: servant/servant-client-ghcjs at master · haskell-servant/servant · GitHub
Below, I’ve included the error output when running nix-build as well as both nix files and the cabal file.
Any tip you may have is very much appreciated!
The error:
$ nix-build
error: anonymous function at /nix/store/wdl7bmcnqfcw9jakpyii93z65wn0mgcr-cabal2nix-app/default.nix:1:1 called without required argument 'servant-client-ghcjs', at /nix/store/9r1vhvri4ba913g4vyg5jqrhg6pb9amn-source/pkgs/development/haskell-modules/make-package-set.nix:87:27
default.nix:
with import ./definitions.nix;
let
server = pkgs.haskell.packages.ghc865.callCabal2nix "app" ./. {};
client = pkgs.haskell.packages.ghcjs86.callCabal2nix "app" ./. {};
in
{
inherit server client;
app = pkgs.runCommand "app" { inherit client server; } ''
mkdir -p $out/{bin,static}
cp ${server}/bin/* $out/bin/
${pkgs.tree}/bin/tree -a ${client}
cp ${client}/bin/client.jsexe/all.js $out/static/
'';
}
definitions.nix:
with (import (builtins.fetchTarball {
url = "https://github.com/dmjio/miso/archive/561ffad.tar.gz";
sha256 = "1wwzckz2qxb873wdkwqmx9gmh0wshcdxi7gjwkba0q51jnkfdi41";
}) {});
let
servant-src = pkgs.fetchFromGitHub {
owner = "haskell-servant";
repo = "servant";
rev = "5998429" ;
sha256 = "1p21x6df0j6zsmjf4z9cahbi15mar80na8rx8hl9mkb9pfrj9dic";
};
in
{
inherit pkgs;
ghcjs86 = pkgs.haskell.packages.ghcjs86.override {
overrides = self: super: with pkgs.haskell.lib; {
servant-client-ghcjs = pkgs.haskell.packages.ghcjs.callCabal2nix "${servant-src}/servant-client-ghcjs" {};
};
};
}
app.cabal:
name: app
version: 0.1.0.0
build-type: Simple
cabal-version: >=1.10
license: PublicDomain
executable server
if impl(ghcjs)
buildable: False
hs-source-dirs: common, server
main-is: Main.hs
ghc-options: -O2 -threaded -Wall -Werror -fwarn-incomplete-patterns -fwarn-incomplete-uni-patterns
default-language: Haskell2010
other-modules: Common
build-depends: aeson,
base < 5,
bytestring,
containers,
cryptonite,
http-types,
lens,
lucid,
miso,
mtl,
network-uri,
persistent,
persistent-sqlite,
persistent-template,
servant,
servant-lucid,
servant-server,
text,
wai,
wai-extra,
wai-cors,
warp
executable client
if !impl(ghcjs)
buildable: False
hs-source-dirs: common, client
ghc-options: -O2 -threaded -Wall -fwarn-incomplete-patterns -fwarn-incomplete-uni-patterns
other-modules: Common
main-is: Main.hs
ghcjs-options: -dedupe
default-language: Haskell2010
build-depends: aeson,
base < 5,
containers,
ghcjs-base,
lens,
miso,
network-uri,
servant,
servant-client-ghcjs,
text