Skip to content

Commit 98d7907

Browse files
committed
Add nix/flake support
Example: nix build github:mimblewimble/grin-wallet ./result/bin/grin-wallet --help
1 parent f0a3830 commit 98d7907

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

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: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
description = "Reference Grin Wallet.";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/release-22.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.1.0";
24+
src = ./.;
25+
26+
cargoLock = {
27+
lockFile = ./Cargo.lock;
28+
outputHashes = {
29+
"grin_api-5.2.0-alpha.1" = "sha256-/cdspz637KXrbo/ckmpubHttOBtP5VTnyuLuFqVqZ/w=";
30+
};
31+
};
32+
33+
nativeBuildInputs = with pkgs;
34+
[
35+
pkg-config
36+
llvmPackages_latest.clang
37+
];
38+
39+
buildInputs = [ pkgs.openssl ];
40+
41+
LIBCLANG_PATH =
42+
"${pkgs.llvmPackages_latest.libclang.lib}/lib";
43+
44+
# do not let test results block the build process
45+
doCheck = false;
46+
};
47+
};
48+
49+
packages = forAllSystems (
50+
system: {
51+
default = nixpkgsFor.${system}.grin-wallet;
52+
}
53+
);
54+
};
55+
}

0 commit comments

Comments
 (0)