-
Notifications
You must be signed in to change notification settings - Fork 132
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
Proposal: Provide a Nix flake for Spago in Nix #963
Conversation
@@ -27,5 +27,6 @@ mkShell { | |||
easy-ps.purescript-language-server | |||
easy-ps.purs-tidy | |||
nodejs | |||
esbuild |
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.
I moved this to the shell instead of npm dependencies, since it's not really needed there.
pkgs.writeShellScriptBin "spago-run" '' | ||
echo "$@" | ||
${pkgs.nodejs}/bin/node --eval 'require("${packages.default}/bundle.js").main()' "$@" | ||
'' | ||
}/bin/spago-run"; |
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 doesn't work right now — perhaps you know how to pass through arguments, @f-f, or how to change the esbuild command?
An alternate implementation can be seen here: |
As per a few discussions we've had lately in the #spago channel of the https://purescript.org/chat, this PR demonstrates building Spago in this repository via the
spago-nix
project. This avoids, for example, the many horrors of node2nix, napalm, npmlock2nix, buildNpmPackage, etc., and includes conveniences for the PureScript portion of building the Spago bundle.This PR demonstrates building Spago itself with Nix and exporting itself from a Nix flake so that users downstream can e.g. run:
and have access to Spago (or use it in their Nix builds). At the moment this is for demonstration purposes only — I don't intend this to be merged until we can discuss the implications.