Skip to content

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.

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/

@syntaxjak
Copy link

✅ Testing Summary

Tested with the following steps:

git clone https://github.com/mimblewimble/grin-wallet.git
cd grin-wallet

git remote add chives101 https://github.com/chives101/grin-wallet.git
git fetch chives101 flake
git checkout -b test-flake chives101/flake

nix build --extra-experimental-features 'nix-command flakes'
./result/bin/grin-wallet init

Result:
The project built successfully without any errors. I expected potential issues such as outdated cargo hashes or overlay scope problems, but neither occurred.

The build completed cleanly, and the resulting grin-wallet binary initialized as expected. The only remaining step would be to confirm functionality via live transactions, but I see no reason this would fail.

Conclusion:
This PR appears fully functional and ready to be merged into the main branch. Excellent work bringing proper flake support to grin-wallet!

@Anynomouss
Copy link
Contributor

Anynomouss commented Oct 14, 2025

Update version = "5.3.0"; to whatever the latest version is 5.4.0-alpha.1.
Update nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; to nixpkgs.url = "github:NixOS/nixpkgs/release-25.05";

Example:

nix build github:mimblewimble/grin-wallet

./result/bin/grin-wallet --help
@chives101
Copy link
Author

Update version = "5.3.0"; to whatever the latest version is 5.4.0-alpha.1. Update nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; to nixpkgs.url = "github:NixOS/nixpkgs/release-25.05";

Updated.

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.

3 participants