diff --git a/flake.lock b/flake.lock index 4bf273ad5..abfcbcd5d 100644 --- a/flake.lock +++ b/flake.lock @@ -133,6 +133,22 @@ "type": "github" } }, + "easy-purescript-nix_2": { + "flake": false, + "locked": { + "lastModified": 1689933391, + "narHash": "sha256-jUuy2OzmxegEn0KT3u1uf87eGGA33+of9HodIqS3PLY=", + "owner": "justinwoo", + "repo": "easy-purescript-nix", + "rev": "5dcea83eecb56241ed72e3631d47e87bb11e45b9", + "type": "github" + }, + "original": { + "owner": "justinwoo", + "repo": "easy-purescript-nix", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -447,6 +463,7 @@ "iogx": { "inputs": { "CHaP": "CHaP", + "easy-purescript-nix": "easy-purescript-nix_2", "flake-utils": "flake-utils", "hackage": "hackage", "haskell-language-server-1_8_0_0": "haskell-language-server-1_8_0_0", @@ -462,8 +479,8 @@ "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, "locked": { - "lastModified": 1691533306, - "narHash": "sha256-YB3NZ/SQLKyBGkyjB/FRDfbSIaJVBe3OudD10tg+4pA=", + "lastModified": 1691616211, + "narHash": "sha256-neN0lbARLQyOfi2XVM47T7BxyR6HqW5vk2Udim2x0vQ=", "type": "git", "url": "file:///Users/zeme/Repos/iogx" }, diff --git a/flake.nix b/flake.nix index 38e396e84..42d4becb1 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; diff --git a/nix/CHECKLIST.md b/nix/CHECKLIST.md index 967d87a2a..084c354f2 100644 --- a/nix/CHECKLIST.md +++ b/nix/CHECKLIST.md @@ -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" ] diff --git a/nix/cabal-project.nix b/nix/cabal-project.nix index 71b0034f3..a5990a792 100644 --- a/nix/cabal-project.nix +++ b/nix/cabal-project.nix @@ -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" ]; diff --git a/nix/ci.nix b/nix/ci.nix index 42be252d6..c58ad0686 100644 --- a/nix/ci.nix +++ b/nix/ci.nix @@ -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" ]; - } \ No newline at end of file diff --git a/nix/formatters.nix b/nix/formatters.nix index 7a591dbed..14a81193f 100644 --- a/nix/formatters.nix +++ b/nix/formatters.nix @@ -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"; - # }; } diff --git a/nix/haskell.nix b/nix/haskell.nix index 59796a112..7b72424a7 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -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"]; } diff --git a/nix/marlowe-playground/generated-purescript.nix b/nix/marlowe-playground/generated-purescript.nix index 8bda9d0c4..061b74f57 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 - ${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 diff --git a/nix/marlowe-playground/operables.nix b/nix/marlowe-playground/operables.nix index aac74833a..7dbf767b9 100644 --- a/nix/marlowe-playground/operables.nix +++ b/nix/marlowe-playground/operables.nix @@ -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 { @@ -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 = '' ################# diff --git a/nix/marlowe-playground/purescript.nix b/nix/marlowe-playground/purescript.nix deleted file mode 100644 index 324f39158..000000000 --- a/nix/marlowe-playground/purescript.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ inputs, pkgs, ... }: -let - p = pkgs.callPackage inputs.easy-purescript-nix { }; -in -p // { purs = p.purs-0_15_2; } diff --git a/nix/marlowe-playground/scripts.nix b/nix/marlowe-playground/scripts.nix index 7b903239e..e177f18cc 100644 --- a/nix/marlowe-playground/scripts.nix +++ b/nix/marlowe-playground/scripts.nix @@ -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 ''; } diff --git a/nix/per-system-outputs.nix b/nix/per-system-outputs.nix index 26c6ae0e3..5a00e02f0 100644 --- a/nix/per-system-outputs.nix +++ b/nix/per-system-outputs.nix @@ -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; } \ No newline at end of file diff --git a/nix/shell.nix b/nix/shell.nix index f39f734bc..9f2c45961 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -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"; @@ -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