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 14, 2023
1 parent 06ee4c8 commit 4439a56
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
18 changes: 18 additions & 0 deletions etc/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ pkgs }:
{
app = pkgs.rustPlatform.buildRustPackage ({
pname = "grin";
version = "5.2.0-alpha.2";
src = ../.;

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

cargoSha256 = "sha256-iCMFlrcoIrpClQOYQpg07DPePdTFLFEkeap2kE0ijzU=";

nativeBuildInputs = [ pkgs.llvmPackages_latest.clang ];
buildInputs = [ pkgs.ncurses ];
LIBCLANG_PATH = "${pkgs.llvmPackages_latest.libclang.lib}/lib";
});
}
61 changes: 61 additions & 0 deletions flake.lock

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

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

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = inputs: with inputs;
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
code = pkgs.callPackage etc/. {};
in rec {
packages = {
app = code.app;
default = packages.app;
};
}
);
}

0 comments on commit 4439a56

Please sign in to comment.