-
Notifications
You must be signed in to change notification settings - Fork 486
An example project that uses plutus as a library #1373
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
Conversation
e216089
to
070619d
Compare
|
||
# launch vs code from this nix-shell | ||
# You must run `code` from within the nix shell in order for Haskell IDE Engine to work correctly | ||
code |
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.
So this has to be done inside the VM, right?
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 work on any machine with nix, updating the README to clarify
packages: | ||
./ | ||
|
||
source-repository-package |
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.
We could really do with haskell/cabal#5472...
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 doubt this type of thing will be in cabal 2.x ever, I imagine we will have to wait for cabal-install 3
@@ -0,0 +1,33 @@ | |||
{ nixpkgs ? <nixpkgs> }: | |||
let | |||
pkgs = import (builtins.fetchTarball { |
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.
Why not do this at the system level? If they're just doing it for one thing we can install HIE globally.
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.
Also, why do we need to pin this? A lot of things here are using the ambient nixpkgs, either we should just assume that it's got a working vscode or we should pin it at the top level.
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.
pinning here means we can use it on any computer and it will work, for example on my mac it works. Same with hie, it all just works having it in this nix shell
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.
For this example I just prefer a known-good setup that should work for everyone
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 guess my concern is that e.g. we're not getting a pinned version of the nixos virtualbox bits, but maybe that's okay.
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.
we are not using anything unstable in the nixos config though and they're pretty good about keeping that working well. There's almost nothing that depends on <nixpkgs>
in there anyway.
@@ -0,0 +1,57 @@ | |||
cabal-version: 1.12 |
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.
Possibly should be a newer version, although I'm not sure that it matters much.
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 what appears in some plutus packages. all this stuff is just from the stack or cabal-install new package template
Given that, in the end, this doesn't share anything with the rest of the repository, not even the default nixpkgs pin, maybe we should just put it in a separate repository? Especially since then it's less annoying if it's out of sync - that just means it's pointing at an older commit. |
I also want to try this out. |
WRT external repository, I don't have an opinion either way except that it might be an administration burden to get a repo set up correctly, why go through the potential pain if we don't need to. |
I'm guessing you need to put some of the stuff that's in the system packages in the shell too. I tried just on my Nixos machine and got:
|
Yeah, it's in the configuration.nix file |
So maybe let's move it to the shell? That way we preserve the property that it will work if you just have Nix installed too. |
I couldn't get it to work in the shell |
Ah right, because we have this system library issue. This is on me, actually, I hadn't run the command to add the Having done so, I see it's written to the |
I thought about that but I don't like changing a file and adding a system specific setting that should be committed. It would be a PITA as your project grew and you wanted more things in shell.nix. You could import something but it works without this addition on most systems where the libs will be in standard locations. |
I mean just tell them to put it in |
Sorry I meant cabal.project not shell.nix. Same thing though, this is an example project that I imagine people will want to share at some point so you want to commit I think if people are using this rather than the VM then they are somewhat likely to want to do this. |
Then: |
Oh I hadn't heard of that, nice |
@michaelpj I've updated the README to comment out that command and leave it as an example with an explanation of what the user might need to do including the option of |
👍 |
It takes about 40 minutes to go from scratch to coding in VS Code in a new virtual machine. We can take a snapshot of a machine to avoid this time though.