-
Notifications
You must be signed in to change notification settings - Fork 461
/
default.nix
38 lines (33 loc) · 1.36 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ pkgs, nix-gitignore, set-git-rev, haskell, webCommon, buildPursPackage, buildNodeModules }:
let
server-invoker = set-git-rev haskell.packages.plutus-scb.components.exes.plutus-scb;
generated-purescript = pkgs.runCommand "plutus-scb-purescript" { } ''
mkdir $out
ln -s ${haskell.packages.plutus-scb.src}/plutus-scb.yaml.sample plutus-scb.yaml
${server-invoker}/bin/plutus-scb psgenerator $out
'';
nodeModules = buildNodeModules {
projectDir = nix-gitignore.gitignoreSource [ "/*.nix" "/*.md" ] ./.;
packageJson = ./package.json;
packageLockJson = ./package-lock.json;
};
client =
buildPursPackage {
inherit webCommon nodeModules;
src = ./.;
name = "plutus-scb-client";
# ideally we would just use `npm run test` but
# this executes `spago` which *always* attempts to download
# remote files (which obviously fails in sandboxed builds)
checkPhase = ''
node -e 'require("./output/Test.Main").main()'
'';
psSrc = generated-purescript;
packages = pkgs.callPackage ./packages.nix { };
spagoPackages = pkgs.callPackage ./spago-packages.nix { };
};
demo-scripts = (dbPath: pkgs.callPackage ./pab-demo-scripts.nix { inherit pkgs dbPath client; scb-exes = haskell.packages.plutus-scb.components.exes; });
in
{
inherit client demo-scripts server-invoker generated-purescript;
}