Skip to content

Commit

Permalink
Add nix/flake support
Browse files Browse the repository at this point in the history
Example:

nix build github:mimblewimble/grin-wallet

./result/bin/grin-wallet --help
  • Loading branch information
chives101 committed Feb 21, 2024
1 parent 75363a9 commit 8e3db8b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ grin.log
wallet.seed
test_output
.idea/
result
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
description = "Reference Grin Wallet.";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
};

outputs = { self, nixpkgs, }:
let
forAllSystems = with nixpkgs;
lib.genAttrs lib.systems.flakeExposed;

nixpkgsFor = forAllSystems (system: import nixpkgs
{ inherit system; overlays = [ self.overlay ]; }
);
in
{
overlay = final: prev:
with final;
{
grin-wallet = pkgs.rustPlatform.buildRustPackage {
pname = "grin-wallet";
version = "5.2.0";
src = ./.;

cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"grin_api-5.3.0-alpha.1" = "sha256-qxMmWCJBtiYsqBJgDA6km7XsToLR2fv/PUUZyM1uAF4=";
};
};

nativeBuildInputs = with pkgs; [ pkg-config clang ];
buildInputs = [ pkgs.openssl ];
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";

# do not let test results block the build process
doCheck = false;
};
};

packages = forAllSystems (
system: {
default = nixpkgsFor.${system}.grin-wallet;
}
);
};
}

0 comments on commit 8e3db8b

Please sign in to comment.