2018-11-22 13:37:37 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd, openssl
|
2018-03-28 06:59:30 +02:00
|
|
|
, donateLevel ? 0
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "xmrig-${version}";
|
2019-06-18 20:25:10 +02:00
|
|
|
version = "2.14.4";
|
2018-03-28 06:59:30 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xmrig";
|
|
|
|
repo = "xmrig";
|
|
|
|
rev = "v${version}";
|
2019-06-18 20:25:10 +02:00
|
|
|
sha256 = "0hmla9ys9gmmcrmkidw05ygiz734rs7skb9w86jnwxi5nlpxqrhj";
|
2018-03-28 06:59:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2018-11-22 13:37:37 +01:00
|
|
|
buildInputs = [ libuv libmicrohttpd openssl ];
|
2018-03-28 06:59:30 +02:00
|
|
|
|
|
|
|
postPatch = ''
|
2019-02-11 23:26:21 +01:00
|
|
|
substituteInPlace src/donate.h \
|
|
|
|
--replace "kDefaultDonateLevel = 5;" "kDefaultDonateLevel = ${toString donateLevel};" \
|
|
|
|
--replace "kMinimumDonateLevel = 1;" "kMinimumDonateLevel = ${toString donateLevel};"
|
2018-03-28 06:59:30 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -vD xmrig $out/bin/xmrig
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Monero (XMR) CPU miner";
|
|
|
|
homepage = "https://github.com/xmrig/xmrig";
|
|
|
|
license = licenses.gpl3Plus;
|
2018-05-08 10:12:13 +02:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2018-03-28 06:59:30 +02:00
|
|
|
maintainers = with maintainers; [ fpletz ];
|
|
|
|
};
|
|
|
|
}
|