-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor and Readme #15
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see below why I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, really anyone who uses this tool should also be consuming easy-purescript-nix https://github.com/justinwoo/easy-purescript-nix/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This didn't work for me, build fails with |
||
''; | ||
# < ... > | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,44 +146,39 @@ INPUTS | |
in { | ||
inherit inputs; | ||
|
||
installSpagoStyle = pkgs.runCommand "install-spago-style" {} '' | ||
>>$out echo "#!/usr/bin/env bash" | ||
>>$out echo | ||
>>$out echo "echo installing dependencies..." | ||
>>$out echo "${builtins.toString ( | ||
builtins.map cpPackage (builtins.attrValues inputs))}" | ||
>>$out echo "echo done." | ||
chmod +x $out | ||
installSpagoStyle = pkgs.writeShellScriptBin "install-spago-style" '' | ||
echo "installing dependencies..." | ||
${builtins.toString ( | ||
builtins.map cpPackage (builtins.attrValues inputs))} | ||
echo "done." | ||
''; | ||
|
||
buildSpagoStyle = pkgs.runCommand "build-spago-style" {} '' | ||
>>$out echo "#!/usr/bin/env bash" | ||
>>$out echo | ||
>>$out echo "echo building project..." | ||
>>$out echo "purs compile ${builtins.toString ( | ||
builtins.map getGlob (builtins.attrValues inputs))}" \"\$@\" | ||
>>$out echo "echo done." | ||
chmod +x $out | ||
buildSpagoStyle = pkgs.writeShellScriptBin "build-spago-style" '' | ||
EXTRA_FILES="$@" | ||
|
||
echo "echo building project..." | ||
echo "purs compile ${builtins.toString ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this should also depend on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i actually do use this script quite often, since mkBuildProjectOutput is the opposite of what i want to use when developing. but yes, changing it to using purescript from easy-purescript-nix is probably fine |
||
builtins.map getGlob (builtins.attrValues inputs))}" \$EXTRA_FILES | ||
echo "echo done." | ||
''; | ||
|
||
buildFromNixStore = pkgs.runCommand "build-from-store" {} '' | ||
>>$out echo "#!/usr/bin/env bash" | ||
>>$out echo | ||
>>$out echo "echo building project using sources from nix store..." | ||
>>$out echo "purs compile ${builtins.toString ( | ||
builtins.map getStoreGlob (builtins.attrValues inputs))}" \"\$@\" | ||
>>$out echo "echo done." | ||
chmod +x $out | ||
buildFromNixStore = pkgs.writeShellScriptBin "build-from-store" '' | ||
EXTRA_FILES="$@" | ||
|
||
echo "echo building project using sources from nix store..." | ||
echo "purs compile ${builtins.toString ( | ||
builtins.map getStoreGlob (builtins.attrValues inputs))}" \$EXTRA_FILES | ||
echo "echo done." | ||
''; | ||
|
||
mkBuildProjectOutput = | ||
{ src, purs }: | ||
{ src, purescript }: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it better to depend on purescript, as that's the package that contains the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, it's just a name change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
pkgs.stdenv.mkDerivation { | ||
name = "build-project-output"; | ||
src = src; | ||
|
||
buildInputs = [ purs ]; | ||
buildInputs = [ purescript ]; | ||
|
||
installPhase = '' | ||
mkdir -p $out | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be
src = ./src;
, because the idea is that you directly consume sources without any directory structure. in addition, because requiring root sources is just not what i think anyone should do without a filter