3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/misc/xmrig/default.nix
2021-05-31 06:33:16 -07:00

38 lines
871 B
Nix

{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd, openssl, hwloc
, donateLevel ? 0
}:
stdenv.mkDerivation rec {
pname = "xmrig";
version = "6.12.2";
src = fetchFromGitHub {
owner = "xmrig";
repo = "xmrig";
rev = "v${version}";
sha256 = "1gjwh509cxs8vqz72v97cir0aazcrd9y9l0k1q5ywbl5l3yf6ryf";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ libuv libmicrohttpd openssl hwloc ];
inherit donateLevel;
patches = [ ./donate-level.patch ];
postPatch = ''
substituteAllInPlace src/donate.h
'';
installPhase = ''
install -vD xmrig $out/bin/xmrig
'';
meta = with lib; {
description = "Monero (XMR) CPU miner";
homepage = "https://github.com/xmrig/xmrig";
license = licenses.gpl3Plus;
platforms = [ "x86_64-linux" "x86_64-darwin" ];
maintainers = with maintainers; [ fpletz kim0 ];
};
}