From c4aad22d1f4eebca548cd7b5ac8e1ee98bd697bd Mon Sep 17 00:00:00 2001 From: Michael Bock Date: Sun, 1 Sep 2019 08:00:18 +0200 Subject: [PATCH] Change README to use mkBuildProjectOutput --- README.md | 9 +++++++-- src/Generate.purs | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 74eb6eb..1a68996 100644 --- a/README.md +++ b/README.md @@ -55,10 +55,15 @@ let in pkgs.stdenv.mkDerivation rec { # < ... > + src = ./.; + + buildInputs = [ spagoPackages.installSpagoStyle ]; + buildPhase = '' - ${spagoPkgs.installSpagoStyle} # == spago2nix install - ${spagoPkgs.buildSpagoStyle} # == spago2nix build + installSpagoStyle # == spago2nix install + + ${spagoPackages.mkBuildProjectOutput { inherit src purescript; }} ''; # < ... > } diff --git a/src/Generate.purs b/src/Generate.purs index 6c37098..cb41df2 100644 --- a/src/Generate.purs +++ b/src/Generate.purs @@ -154,20 +154,20 @@ in { ''; buildSpagoStyle = pkgs.writeShellScriptBin "build-spago-style" '' - EXTRA_FILES=$@ + EXTRA_FILES="$@" echo "echo building project..." echo "purs compile ${builtins.toString ( - builtins.map getGlob (builtins.attrValues inputs))}" \"\$EXTRA_FILES\" + builtins.map getGlob (builtins.attrValues inputs))}" \$EXTRA_FILES echo "echo done." ''; buildFromNixStore = pkgs.writeShellScriptBin "build-from-store" '' - EXTRA_FILES=$@ + EXTRA_FILES="$@" echo "echo building project using sources from nix store..." echo "purs compile ${builtins.toString ( - builtins.map getStoreGlob (builtins.attrValues inputs))}" \"\$EXTRA_FILES\" + builtins.map getStoreGlob (builtins.attrValues inputs))}" \$EXTRA_FILES echo "echo done." '';