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 17, 2023
1 parent f0a3830 commit d7505e9
Show file tree
Hide file tree
Showing 2 changed files with 87 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.

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

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

outputs = { self, nixpkgs, }:
let
supportedSystems =
[
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
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 d7505e9

Please sign in to comment.