Skip to content

Commit

Permalink
Integrate with IOGX
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana committed Aug 10, 2023
1 parent 622565c commit b3ff6a1
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 96 deletions.
134 changes: 67 additions & 67 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@

inputs = {

iogx.url = "github:input-output-hk/haskell.nix";
iogx.url = "github:input-output-hk/iogx";
iogx.inputs.nixpkgs.follows = "nixpkgs";

easy-purescript-nix = {
url = "github:justinwoo/easy-purescript-nix";
flake = false;
};
nixpkgs.url = "github:NixOS/nixpkgs/9952d6bc395f5841262b006fbace8dd7e143b634";

n2c.url = "github:nlewo/nix2container";

Expand Down
10 changes: 5 additions & 5 deletions nix/marlowe-playground/generated-purescript.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{ nix, pkgs, inputs, ... }:
{ nix, pkgs, inputs', ... }:

# Output containing the purescript bridge code
pkgs.runCommand "generated-purescript" { } ''
mkdir $out
${inputs.self'.apps.marlowe-playground-server}/bin/marlowe-playground-server psgenerator $out
cp ${builtins.path { name = "tidyrc.json"; path = inputs.self + "/.tidyrc.json"; } } $out/.tidyrc.json
cp ${builtins.path { name = "tidyoperators"; path = inputs.self + "/.tidyoperators"; } } $out/.tidyoperators
${inputs'.self.packages.marlowe-playground-server}/bin/marlowe-playground-server psgenerator $out
cp ${builtins.path { name = "tidyrc.json"; path = inputs'.self + "/.tidyrc.json"; } } $out/.tidyrc.json
cp ${builtins.path { name = "tidyoperators"; path = inputs'.self + "/.tidyoperators"; } } $out/.tidyoperators
cd $out
${inputs.iogx.inputs.easy-purescript-nix.purs-tidy}/bin/purs-tidy format-in-place *
${inputs'.iogx.inputs.easy-purescript-nix.purs-tidy}/bin/purs-tidy format-in-place *
${pkgs.nodePackages.prettier}/bin/prettier -w .
rm -f $out/.tidyrc.json
rm -f $out/.tidyoperators
Expand Down
7 changes: 3 additions & 4 deletions nix/marlowe-playground/operables.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ project:

let

inherit (inputs'.self.apps) marlowe-playground-client marlowe-playground-server;
inherit (pkgs) darkhttpd lib mailcap coreutils cacert z3;
inherit (inputs.std.lib.ops) mkOperable;

Expand All @@ -16,11 +15,11 @@ in
package = marlowe-playground-client;
runtimeInputs = [ darkhttpd ];
runtimeScript = ''
exec darkhttpd "''${CONFIG_HTML_ROOT:-${inputs'.self.apps.marlowe-playground-client}}" --port 8080 --mimetypes ${mailcap}/etc/mime.types
exec darkhttpd "''${CONFIG_HTML_ROOT:-${inputs'.self.packages.marlowe-playground-client}}" --port 8080 --mimetypes ${mailcap}/etc/mime.types
'';
};
marlowe-playground-server = mkOperable {
package = inputs.self'.packages.marlowe-playground-server-exe-marlowe-playground-server-ghc8107;
package = inputs.self'.packages.marlowe-playground-server;
runtimeInputs = [ ghc-with-marlowe coreutils cacert z3 ];
runtimeScript = ''
#################
Expand All @@ -47,7 +46,7 @@ in
mkdir -p /tmp
${marlowe-playground-server}/bin/marlowe-playground-server webserver
${inputs'.self.packages.marlowe-playground-server}/bin/marlowe-playground-server webserver
'';
};
}
4 changes: 2 additions & 2 deletions nix/marlowe-playground/scripts.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ nix, ... }:
{ inputs', ... }:

{

Expand Down Expand Up @@ -31,7 +31,7 @@
cd marlowe-playground-client
${inputs.iogx.inputs.easy-purescript-nix.spago2nix}/bin/spago2nix generate
${inputs'.iogx.inputs.easy-purescript-nix.spago2nix}/bin/spago2nix generate
'';

}
4 changes: 1 addition & 3 deletions nix/per-system-outputs.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# This file is part of the IOGX template and is documented at the link below:
# https://www.github.com/input-output-hk/iogx#35-nixper-system-outputsnix

{ nix, inputs', projects, ... }:
{ nix, projects, ... }:

{
packages.generated-purescript = nix.marlowe-playground.generated-purescript;

packages.marlowe-playground-client = nix.marlowe-playground.marlowe-playground-client;

packages.marlowe-playground-server = inputs'.self.packages.marlowe-playground-server-exe-marlowe-playground-server-ghc8107;

packages.playwright = nix.marlowe-playground.playwright;

operables = nix.marlowe-cardano.operables projects.default;
Expand Down
Loading

0 comments on commit b3ff6a1

Please sign in to comment.