2018-04-09 13:00:42 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd, libuuid
|
|
|
|
, donateLevel ? 0
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "xmrig-proxy-${version}";
|
2018-07-13 01:56:23 +01:00
|
|
|
version = "2.6.4";
|
2018-04-09 13:00:42 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xmrig";
|
|
|
|
repo = "xmrig-proxy";
|
|
|
|
rev = "v${version}";
|
2018-07-13 01:56:23 +01:00
|
|
|
sha256 = "0h6ihrrkgwi8k642iqq13qx3zlxl9r8q7wm417hb7j35rnmwn8lq";
|
2018-04-09 13:00:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ libuv libmicrohttpd libuuid ];
|
|
|
|
|
2018-04-10 11:57:05 +01:00
|
|
|
# Set default donation level to 0%. Can be increased at runtime via --donate-level option.
|
2018-04-09 13:00:42 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/donate.h --replace "kDonateLevel = 2;" "kDonateLevel = ${toString donateLevel};"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -vD xmrig-proxy $out/bin/xmrig-proxy
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Monero (XMR) Stratum protocol proxy";
|
|
|
|
homepage = "https://github.com/xmrig/xmrig-proxy";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ aij ];
|
|
|
|
};
|
|
|
|
}
|