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

./result/bin/grin --help
  • Loading branch information
chives101 committed Apr 17, 2023
1 parent 06ee4c8 commit defd062
Show file tree
Hide file tree
Showing 2 changed files with 78 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.

51 changes: 51 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
description = "THE MIMBLEWIMBLE BLOCKCHAIN.";

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 = pkgs.rustPlatform.buildRustPackage {
pname = "grin";
version = "5.2.0-alpha.2";
src = ./.;

cargoLock = {
lockFile = ./Cargo.lock;
};

nativeBuildInputs = [ pkgs.llvmPackages_latest.clang ];
buildInputs = [ pkgs.ncurses ];
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;
}
);
};
}

0 comments on commit defd062

Please sign in to comment.