From 752d3ade8bd77ba0e6906eeda3cbc08cead9571a Mon Sep 17 00:00:00 2001 From: zeme Date: Fri, 18 Aug 2023 10:04:26 +0200 Subject: [PATCH] WIP --- flake.lock | 31 +++++-------------- flake.nix | 3 -- .../easy-purescript-nix.nix | 5 +++ .../generated-purescript.nix | 2 +- .../marlowe-playground-client.nix | 4 +-- nix/marlowe-playground/oci-images.nix | 2 +- nix/marlowe-playground/operables.nix | 2 +- nix/marlowe-playground/scripts.nix | 2 +- nix/per-system-outputs.nix | 7 +++-- nix/shell.nix | 21 +++++++------ 10 files changed, 34 insertions(+), 45 deletions(-) create mode 100644 nix/marlowe-playground/easy-purescript-nix.nix diff --git a/flake.lock b/flake.lock index a6cc8ef38..cf81c0cfe 100644 --- a/flake.lock +++ b/flake.lock @@ -455,18 +455,18 @@ "haskell-nix": "haskell-nix", "iohk-nix": "iohk-nix", "nixpkgs": [ - "nixpkgs" + "iogx", + "haskell-nix", + "nixpkgs-2305" ], "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, "locked": { - "lastModified": 1691673963, - "narHash": "sha256-ysa3pHrA2CTqsO7nXGU6PaOipbq+P2YIjRAcVZSpYtk=", - "owner": "input-output-hk", - "repo": "iogx", - "rev": "84eb718a3560c6dec18edb86eb56c4acc48c6d9e", - "type": "github" + "lastModified": 1691694349, + "narHash": "sha256-yv1IO5/3rgTcA0uGzfhEcODEbYPAyR/BZ00LlPx+UnY=", + "type": "git", + "url": "file:///Users/zeme/Repos/iogx" }, "original": { "owner": "input-output-hk", @@ -762,22 +762,6 @@ "type": "github" } }, - "nixpkgs_4": { - "locked": { - "lastModified": 1677383253, - "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", - "type": "github" - } - }, "npmlock2nix": { "flake": false, "locked": { @@ -837,7 +821,6 @@ "inputs": { "iogx": "iogx", "n2c": "n2c", - "nixpkgs": "nixpkgs_4", "npmlock2nix": "npmlock2nix" } }, diff --git a/flake.nix b/flake.nix index f45943350..16af882f0 100644 --- a/flake.nix +++ b/flake.nix @@ -8,9 +8,6 @@ inputs = { iogx.url = "github:input-output-hk/iogx"; - iogx.inputs.nixpkgs.follows = "nixpkgs"; - - nixpkgs.url = "github:NixOS/nixpkgs/9952d6bc395f5841262b006fbace8dd7e143b634"; n2c.url = "github:nlewo/nix2container"; diff --git a/nix/marlowe-playground/easy-purescript-nix.nix b/nix/marlowe-playground/easy-purescript-nix.nix new file mode 100644 index 000000000..2f004ddbe --- /dev/null +++ b/nix/marlowe-playground/easy-purescript-nix.nix @@ -0,0 +1,5 @@ +{ inputs, system, ... }: +let + easy-purescript-nix = import inputs.iogx.inputs.easy-purescript-nix {}; +in + easy-purescript-nix // { purs = easy-purescript-nix.purs-0_15_2; } \ No newline at end of file diff --git a/nix/marlowe-playground/generated-purescript.nix b/nix/marlowe-playground/generated-purescript.nix index 9d983a4ca..23b59e702 100644 --- a/nix/marlowe-playground/generated-purescript.nix +++ b/nix/marlowe-playground/generated-purescript.nix @@ -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 - ${inputs'.iogx.inputs.easy-purescript-nix.purs-tidy}/bin/purs-tidy format-in-place * + ${nix.marlowe-playground.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 diff --git a/nix/marlowe-playground/marlowe-playground-client.nix b/nix/marlowe-playground/marlowe-playground-client.nix index d8fb52c9c..ae225287f 100644 --- a/nix/marlowe-playground/marlowe-playground-client.nix +++ b/nix/marlowe-playground/marlowe-playground-client.nix @@ -20,8 +20,8 @@ npmlock2nix.v1.build { spagoPkgs.installSpagoStyle spagoPkgs.buildSpagoStyle pkgs.nodejs_14x.pkgs.npm - nix.marlowe-cardano.purescript.spago2nix - nix.marlowe-cardano.purescript.purs + nix.marlowe-playground.easy-purescript-nix.purs + nix.marlowe-playground.easy-purescript-nix.spago2nix ]; unpackPhase = '' mkdir -p marlowe-playground-client diff --git a/nix/marlowe-playground/oci-images.nix b/nix/marlowe-playground/oci-images.nix index 93d92074e..09e028cb3 100644 --- a/nix/marlowe-playground/oci-images.nix +++ b/nix/marlowe-playground/oci-images.nix @@ -7,7 +7,7 @@ let mkStandardOCI { inherit name; # meta.tags = [ "latest" ]; - operable = inputs.self'.operables.${name}; + operable = inputs'.self.operables.${name}; uid = "0"; gid = "0"; labels = { diff --git a/nix/marlowe-playground/operables.nix b/nix/marlowe-playground/operables.nix index d3af39a64..4d514dbdc 100644 --- a/nix/marlowe-playground/operables.nix +++ b/nix/marlowe-playground/operables.nix @@ -19,7 +19,7 @@ in ''; }; marlowe-playground-server = mkOperable { - package = inputs.self'.packages.marlowe-playground-server; + package = inputs'.self.packages.marlowe-playground-server; runtimeInputs = [ ghc-with-marlowe coreutils cacert z3 ]; runtimeScript = '' ################# diff --git a/nix/marlowe-playground/scripts.nix b/nix/marlowe-playground/scripts.nix index 3b895107b..de5f79850 100644 --- a/nix/marlowe-playground/scripts.nix +++ b/nix/marlowe-playground/scripts.nix @@ -31,7 +31,7 @@ cd marlowe-playground-client - ${inputs'.iogx.inputs.easy-purescript-nix.spago2nix}/bin/spago2nix generate + ${nix.marlowe-playground.easy-purescript-nix.spago2nix}/bin/spago2nix generate ''; } diff --git a/nix/per-system-outputs.nix b/nix/per-system-outputs.nix index ea051e566..9fcf731fd 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 -{ nix, projects, ... }: +{ nix, inputs', inputs, projects, ... }: { packages.generated-purescript = nix.marlowe-playground.generated-purescript; @@ -10,7 +10,8 @@ packages.playwright = nix.marlowe-playground.playwright; - operables = nix.marlowe-cardano.operables projects.default; + operables = nix.marlowe-playground.operables projects.default; + + oci-images = nix.marlowe-playground.oci-images; - oci-images = nix.marlowe-cardano.oci-images; } \ No newline at end of file diff --git a/nix/shell.nix b/nix/shell.nix index 3478459a6..d16a06a8c 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -1,14 +1,17 @@ # 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, inputs', pkgs, ... }: +{ nix, inputs', pkgs, system, l, ... }: { name = "marlowe-playground"; env = { - PLAYWRIGHT_BROWSERS_PATH = "${nix.marlowe-playground.playwright}"; + PLAYWRIGHT_BROWSERS_PATH = + l.optionalString (system == "x86_64-linux") + "${nix.marlowe-playground.playwright}"; + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "true"; }; @@ -33,13 +36,13 @@ packages = [ - 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 + nix.marlowe-playground.easy-purescript-nix.purs-tidy + nix.marlowe-playground.easy-purescript-nix.purs + nix.marlowe-playground.easy-purescript-nix.spago + nix.marlowe-playground.easy-purescript-nix.spago2nix + nix.marlowe-playground.easy-purescript-nix.psa + nix.marlowe-playground.easy-purescript-nix.purescript-language-server + nix.marlowe-playground.easy-purescript-nix.pscid pkgs.jq pkgs.yq