Skip to content

Commit 8e3db8b

Browse files
committed
Add nix/flake support
Example: nix build github:mimblewimble/grin-wallet ./result/bin/grin-wallet --help
1 parent 75363a9 commit 8e3db8b

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ grin.log
1111
wallet.seed
1212
test_output
1313
.idea/
14+
result

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
description = "Reference Grin Wallet.";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
6+
};
7+
8+
outputs = { self, nixpkgs, }:
9+
let
10+
forAllSystems = with nixpkgs;
11+
lib.genAttrs lib.systems.flakeExposed;
12+
13+
nixpkgsFor = forAllSystems (system: import nixpkgs
14+
{ inherit system; overlays = [ self.overlay ]; }
15+
);
16+
in
17+
{
18+
overlay = final: prev:
19+
with final;
20+
{
21+
grin-wallet = pkgs.rustPlatform.buildRustPackage {
22+
pname = "grin-wallet";
23+
version = "5.2.0";
24+
src = ./.;
25+
26+
cargoLock = {
27+
lockFile = ./Cargo.lock;
28+
outputHashes = {
29+
"grin_api-5.3.0-alpha.1" = "sha256-qxMmWCJBtiYsqBJgDA6km7XsToLR2fv/PUUZyM1uAF4=";
30+
};
31+
};
32+
33+
nativeBuildInputs = with pkgs; [ pkg-config clang ];
34+
buildInputs = [ pkgs.openssl ];
35+
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
36+
37+
# do not let test results block the build process
38+
doCheck = false;
39+
};
40+
};
41+
42+
packages = forAllSystems (
43+
system: {
44+
default = nixpkgsFor.${system}.grin-wallet;
45+
}
46+
);
47+
};
48+
}

0 commit comments

Comments
 (0)