Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana committed Aug 18, 2023
1 parent 41c0d1f commit 9a54b6b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
4 changes: 2 additions & 2 deletions flake.lock

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

7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
outputs = inputs: inputs.iogx.lib.mkFlake {
inherit inputs;
repoRoot = ./.;
nixpkgsConfig = {
permittedInsecurePackages = [
"python-2.7.18.6"
"nodejs-14.21.3"
"openssl-1.1.1t"
];
};
};


Expand Down
4 changes: 2 additions & 2 deletions nix/marlowe-playground/marlowe-playground-client.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ repoRoot, inputs, pkgs, ... }:

let
npmlock2nix = inputs.npmlock2nix { inherit pkgs; };
npmlock2nix = import inputs.npmlock2nix { inherit pkgs; };

spagoPkgs = import (inputs.self + "/marlowe-playground-client/spago-packages.nix") { inherit pkgs; };
in
Expand All @@ -19,7 +19,7 @@ npmlock2nix.v1.build {
buildInputs = [
spagoPkgs.installSpagoStyle
spagoPkgs.buildSpagoStyle
pkgs.nodejs_18_x.pkgs.npm
pkgs.nodejs-18_x.pkgs.npm
repoRoot.nix.marlowe-playground.easy-purescript-nix.purs
repoRoot.nix.marlowe-playground.easy-purescript-nix.spago2nix
];
Expand Down
16 changes: 8 additions & 8 deletions nix/marlowe-playground/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
{

generate-purescript = ''
cd "$(git rev-parse --show-toplevel)"
repo_root="$(git rev-parse --show-toplevel)"
generated=./marlowe-playground-client/generated
generated="$repo_root/marlowe-playground-client/generated"
# Clean old build
rm -rf $generated
rm -rf "$generated"
mkdir -p "$generated"
# Re-generate the files
cp -r $(nix build .#generated-purescript --no-link --print-out-paths) $generated
chmod -R +w $generated
cp -r "$(nix build .#generated-purescript --no-link --print-out-paths "$@")/." "$generated"
chmod -R +w "$generated"
'';


start-backend = ''
cd "$(git rev-parse --show-toplevel)"
echo "marlowe-playground-server: for development use only"
export PATH="$(nix build .#ghc-with-marlowe --no-link --print-out-paths)/bin:$PATH"
export PATH="$(nix build .#ghc-with-marlowe --no-link --print-out-paths "$@")/bin:$PATH"
export FRONTEND_URL=https://localhost:8009
nix run .#marlowe-playground-server -- webserver
nix run .#marlowe-playground-server "$@" -- webserver
'';


Expand Down
6 changes: 3 additions & 3 deletions nix/per-system-outputs.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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

{ repoRoot, haskellProjects, pkgs, ... }:
{ repoRoot, haskellProjects, ... }:

{
packages.generated-purescript = repoRoot.nix.marlowe-playground.generated-purescript;
Expand All @@ -10,9 +10,9 @@

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

packages.ghc-with-marlowe = haskellProjects.default.ghcWithPackages (pkgs: [ pkgs.marlowe-cardano ]);

operables = repoRoot.nix.marlowe-playground.operables haskellProjects.default;

oci-images = repoRoot.nix.marlowe-playground.oci-images;

pkgs = pkgs;
}
6 changes: 3 additions & 3 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
scripts.generate-purescript = {
exec = repoRoot.nix.marlowe-playground.scripts.generate-purescript;
description = "Generate all PureScript Bridge code";
group = "purescript";
group = "marlowe-playground";
};

scripts.update-client-deps = {
exec = repoRoot.nix.marlowe-playground.scripts.update-client-deps;
description = "Run spago2nix in marlowe-playground-client";
group = "purescript";
group = "marlowe-playground";
};

scripts.start-backend = {
exec = repoRoot.nix.marlowe-playground.scripts.start-backend;
description = "Start the Marlowe Playground server";
group = "general";
group = "marlowe-playground";
};


Expand Down

0 comments on commit 9a54b6b

Please sign in to comment.