Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a counter part of mimblewimble/grin#3743 , which adds nix/flake support to the daemon. The following description is almost identical.
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-wallet
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-wallet/flake
and expect a binary at./result/bin/grin-wallet
.Or by entering the project folder and do
nix build
after applying the PR.Maintenance
Each time
cargo.lock
is updated,cargoLock.outputHashes
needs to beupdated in
flake.nix
. It can be done by simply giving a dummy hash, and observe the errorgenerated from the build log.
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/