Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Calegari committed Aug 10, 2023
1 parent 61958d8 commit 622565c
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 35 deletions.
21 changes: 19 additions & 2 deletions flake.lock

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

3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the IOGX template and is documented at the link below:
# https://www.github.com/input-output-hk/iogx#31-flakenix

{
description = "Marlowe Playground";

Expand Down
2 changes: 0 additions & 2 deletions nix/CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@
permittedInsecurePackages = [ "python-2.7.18.6" ];
};

# purs-tidy
write-formatter "purs-tidy" "${purs-tidy}/bin/purs-tidy format-in-place" [ "purs" ]
3 changes: 3 additions & 0 deletions nix/cabal-project.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the IOGX template and is documented at the link below:
# https://www.github.com/input-output-hk/iogx#33-nixcabal-projectnix

{
modules = [{
packages.marlowe-symbolic.ghcOptions = [ "-Werror" ];
Expand Down
10 changes: 7 additions & 3 deletions nix/ci.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# This file is part of the IOGX template and is documented at the link below:
# https://www.github.com/input-output-hk/iogx#39-nixcinix

{ l, pkgs, ... }:

{
includedPaths = [
"operables"
includedPaths = l.optionals pkgs.stdenv.hostPlatform.isLinux [
"oci-images"
"operables"
];

}
12 changes: 3 additions & 9 deletions nix/formatters.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# This file is part of the IOGX template and is documented at the link below:
# https://www.github.com/input-output-hk/iogx#38-nixformattersnix

{
shellcheck.enable = true;
stylish-haskell.enable = true;
nixpkgs-fmt.enable = true;
prettier.enable = true;
#types_or = [ "javascript" "css" "html" ]; TODO
purs-tidy.enable = true;
# = { TODO
# enable = true;
# name = "purs-tidy";
# description = "Ensure PureScript files are formatted";
# entry = "${purescript.purs-tidy}/bin/purs-tidy format-in-place";
# files = "\\.purs$";
# language = "system";
# };
}
3 changes: 3 additions & 0 deletions nix/haskell.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of the IOGX template and is documented at the link below:
# https://www.github.com/input-output-hk/iogx#32-nixhaskellnix

{
supportedCompilers = ["ghc8107"];
}
2 changes: 1 addition & 1 deletion nix/marlowe-playground/generated-purescript.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pkgs.runCommand "generated-purescript" { } ''
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
${nix.marlowe-playground.purescript.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
9 changes: 7 additions & 2 deletions nix/marlowe-playground/operables.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{ inputs, inputs', pkgs, ... }:

project:

let

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

ghc-with-marlowe = project.ghcWithPackages (pkgs: [ pkgs.marlowe-cardano ]);

in
{
marlowe-playground-client = mkOperable {
Expand All @@ -15,7 +20,7 @@ in
'';
};
marlowe-playground-server = mkOperable {
package = inputs.self'.apps.marlowe-playground-server;
package = inputs.self'.packages.marlowe-playground-server-exe-marlowe-playground-server-ghc8107;
runtimeInputs = [ ghc-with-marlowe coreutils cacert z3 ];
runtimeScript = ''
#################
Expand Down
5 changes: 0 additions & 5 deletions nix/marlowe-playground/purescript.nix

This file was deleted.

2 changes: 1 addition & 1 deletion nix/marlowe-playground/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
cd marlowe-playground-client
${nix.marlowe-playground.purescript.spago2nix}/bin/spago2nix generate
${inputs.iogx.inputs.easy-purescript-nix.spago2nix}/bin/spago2nix generate
'';

}
12 changes: 10 additions & 2 deletions nix/per-system-outputs.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{ nix, inputs', ... }:
# 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, ... }:

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

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

packages.marlowe-playground-server = inputs'.self.apps.marlowe-playground-server;
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;

oci-images = nix.marlowe-cardano.oci-images;
}
19 changes: 11 additions & 8 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{ inputs, pkgs, ... }:
# This file is part of the IOGX template and is documented at the link below:
# https://www.github.com/input-output-hk/iogx#34-nixshellnix

{ nix, pkgs, ... }:

{
name = "marlowe-playground";
Expand Down Expand Up @@ -30,13 +33,13 @@


packages = [
nix.marlowe-playground.purescript.purs-tidy
nix.marlowe-playground.purescript.purs
nix.marlowe-playground.purescript.spago
nix.marlowe-playground.purescript.spago2nix
nix.marlowe-playground.purescript.psa
nix.marlowe-playground.purescript.purescript-language-server
nix.marlowe-playground.purescript.pscid
inputs.iogx.inputs.easy-purescript-nix.purs-tidy
inputs.iogx.inputs.easy-purescript-nix.purs
inputs.iogx.inputs.easy-purescript-nix.spago
inputs.iogx.inputs.easy-purescript-nix.spago2nix
inputs.iogx.inputs.easy-purescript-nix.psa
inputs.iogx.inputs.easy-purescript-nix.purescript-language-server
inputs.iogx.inputs.easy-purescript-nix.pscid

pkgs.jq
pkgs.yq
Expand Down

0 comments on commit 622565c

Please sign in to comment.