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 of nix 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 be
updated in flake.nix. It can be done by simply giving a dummy hash, and observe the error
generated from the build log.
Dev notes
This PR is the result of a simple adaptation of the code from this blog post:
This PR is a counter part of https://github.com/mimblewimble/grin/pull/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 be updated inflake.nix
. It can be done by simply giving a dummy hash, and observe the error generated 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/