From 9a54b6b987027740ca0ec1b2e2d95a02634473b6 Mon Sep 17 00:00:00 2001 From: zeme Date: Fri, 18 Aug 2023 15:47:49 +0200 Subject: [PATCH] WIP --- flake.lock | 4 ++-- flake.nix | 7 +++++++ .../marlowe-playground-client.nix | 4 ++-- nix/marlowe-playground/scripts.nix | 16 ++++++++-------- nix/per-system-outputs.nix | 6 +++--- nix/shell.nix | 6 +++--- 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index b390e0d09..0f0cd22da 100644 --- a/flake.lock +++ b/flake.lock @@ -463,8 +463,8 @@ "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, "locked": { - "lastModified": 1691694349, - "narHash": "sha256-n2NNK4neXzowON2I0FpDr17CBtNPVpGClv2h/yGzzrk=", + "lastModified": 1692351193, + "narHash": "sha256-qZ/kLEfu2TOx6opWKqiRZ+aMWT51/KM6aaEgDsX79ro=", "type": "git", "url": "file:///Users/zeme/Repos/iogx" }, diff --git a/flake.nix b/flake.nix index 16af882f0..17e80995b 100644 --- a/flake.nix +++ b/flake.nix @@ -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" + ]; + }; }; diff --git a/nix/marlowe-playground/marlowe-playground-client.nix b/nix/marlowe-playground/marlowe-playground-client.nix index 2a2786e94..efe748a7e 100644 --- a/nix/marlowe-playground/marlowe-playground-client.nix +++ b/nix/marlowe-playground/marlowe-playground-client.nix @@ -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 @@ -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 ]; diff --git a/nix/marlowe-playground/scripts.nix b/nix/marlowe-playground/scripts.nix index bf5dc306b..5e61a91e6 100644 --- a/nix/marlowe-playground/scripts.nix +++ b/nix/marlowe-playground/scripts.nix @@ -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 ''; diff --git a/nix/per-system-outputs.nix b/nix/per-system-outputs.nix index 4833d83fb..95b7be68c 100644 --- a/nix/per-system-outputs.nix +++ b/nix/per-system-outputs.nix @@ -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; @@ -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; } diff --git a/nix/shell.nix b/nix/shell.nix index ee8c47fec..422443c85 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -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"; };