-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add Nix flake support #76
base: golang
Are you sure you want to change the base?
Conversation
@@ -6,6 +6,7 @@ packages: | |||
extra-deps: | |||
- git: https://github.com/purescript/purescript | |||
commit: 9cad73ed8ea7df3011032ddbd2f3de5a0c08629c | |||
# nix-sha256: 0mlgww6j8nfdgy6x7l6z5in37r6qs11wnxf1cpgqaiyabadaik20 |
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 is necessary because the commit isn't in the default branch (master
).
Without this, Nix (haskell.nix) complains that it can't find the commit.
For consuming the
|
]; | ||
|
||
overlay = final: prev: { | ||
# This dummy package is required in building the project, but `hsc2hs` is actually provided by GHC. |
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.
It's part of the built GHC env, in any case. I'm not sure if this is the right way of fixing it, but it seems to work.
So, with one ephemeral change from this branch's current state:
I'm able to run the tests for the @andyarvanitis, is there/do you have a nice process of generating analogous output using the node/JS backend, or should I just temporarily modify |
This adds Nix flake support, and replaces the default non-Stack Nix build (
default.nix
) with one that produces the default package from the flake.I've created a public binary cache on Cachix that I've pushed the flake's associated derivations to.
For now, this only has
x86_64-linux
derivations, as I don't presently have access to a mac build host.To hack on
psgo
itself, you can runnix develop github:jjthiessen/purescript-native/add-flakes#hacking-on-psgo
(in this case, you'll have it checked out anyway, so you can use relative file system path references instead).To use
psgo
in a project, you can runnix develop github:jjthiessen/purescript-native/add-flakes#using-psgo
(or reference it with a relative path if you're trying to use a non-released version).I think that the two bundled development shells should be generally useful, but I'd be interested to know what people think should or shouldn't be included.
Apart from the shells, the flake provides both
psgo
andpurescript
/purs
as packages/apps.Both
psgo
andpurescript
are included as I figured it could be important to use the same version of PureScript withpsgo
as the one that it was compiled against (and this ensures that it's the same commit).You can directly execute binaries by doing something like
nix run github:jjthiessen/purescript-native/add-flakes#psgo
.This still isn't perfect.
I'd like to figure out whether I can reduce the closure size at all, and it'd be nice if the Nix-enabled Stack build (
stack --nix build
) could use the same derivations as the flake/haskell.nix'sstackProject
(I'm not sure if this can be done).