-
Notifications
You must be signed in to change notification settings - Fork 990
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
feat: Add nix/flake support #3743
Conversation
1c5f73e
to
dc3cd2f
Compare
9fe7301
to
bbbf949
Compare
b792b32
to
d0dbe76
Compare
@chives101 I seem to have a rather strange encoding issue when I run it with |
@phyro iirc this might be something related with libncurses. |
@phyro Is it tested with the latest repo? I did a force push that updated the nixpkgs dependency which was pretty outdated. I just tested the repo, works fine for me. BTW, you can do a local test by entering the project folder and do |
951a09f
to
6e21d1b
Compare
@phyro I did a fresh build on debian bullseye, I couldn't reproduce your issue though. |
4380c16
to
55bc203
Compare
on nixos 22.11 it worked for me although it's weird that @phyro is getting these characters. I recall having the same problem but i've fixed it by installing newer ncurses or some other package. Will try to reproduce the problem. |
Example: nix build github:mimblewimble/grin ./result/bin/grin --help
result is the default symlink output for nix build
@pkariz It is weird, because flake is supposed to be hermetic. Guess it's not that airtight after all. |
@chives101 apologies that I didn't get back to you. I tried it again with the latest changes and I get the same. It seems @pkariz can't test this right now. My suggestion is to take the incremetal improvement appoach and merge it in. The current solution seems to work at least for those that are on nixos and some others (debian above) and this itself is valuable. It's also my observation that quite a few people in the Rust community like Nix so we'll likely get more people to chime in and patch it over time. I'll wait a bit in case someone disagrees with merging, otherwise I'll go ahead and merge it. |
Thanks for your contribution @chives101 ! I'm not around my PC to test the grin-wallet PR again after the changes until next week, but will do that then. 👍 |
@phyro It's fine, it's nothing. I'm pretty sure there's more I can do :D |
Motivation
This PR enables power users to easily and reliably build the project from source code.
Expectation
A user with the nix package manager installed can build the project with the following command:
nix build github:mimblewimble/grin
and expect the resulting binaries in
./result/bin
.Testing
If flake hasn't been enabled, use
nix build --extra-experimental-features 'nix-command flakes'
in place ofnix build
.A test run for this PR can be achieved using my forked repo with the following command:
nix build github:chives101/grin/flake
and expect a binary at./result/bin/grin
.Or by entering the project folder and do
nix build
after applying the PR.Dev notes
This PR is the result of a simple adaptation of the code from this blog post:
https://www.tweag.io/blog/2022-09-22-rust-nix/