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 Apr 20, 2023
1 parent f0a3830 commit 98d7907
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
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.

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

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.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.1.0";
src = ./.;

cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"grin_api-5.2.0-alpha.1" = "sha256-/cdspz637KXrbo/ckmpubHttOBtP5VTnyuLuFqVqZ/w=";
};
};

nativeBuildInputs = with pkgs;
[
pkg-config
llvmPackages_latest.clang
];

buildInputs = [ pkgs.openssl ];

LIBCLANG_PATH =
"${pkgs.llvmPackages_latest.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 98d7907

Please sign in to comment.