Skip to content
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 #680

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chives101
Copy link

@chives101 chives101 commented Apr 14, 2023

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 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:

https://www.tweag.io/blog/2022-09-22-rust-nix/

Example:

nix build github:mimblewimble/grin-wallet

./result/bin/grin-wallet --help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant