mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 13:43:22 +00:00
37 lines
993 B
Nix
37 lines
993 B
Nix
{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd, openssl, hwloc
|
|
, donateLevel ? 0
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "xmrig";
|
|
version = "6.6.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "xmrig";
|
|
repo = "xmrig";
|
|
rev = "v${version}";
|
|
sha256 = "03phq1c6fylvkg5x7l0bskspr9jdfx61jy67yx2lxhymqgpbf64z";
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
buildInputs = [ libuv libmicrohttpd openssl hwloc ];
|
|
|
|
postPatch = ''
|
|
substituteInPlace src/donate.h \
|
|
--replace "kDefaultDonateLevel = 5;" "kDefaultDonateLevel = ${toString donateLevel};" \
|
|
--replace "kMinimumDonateLevel = 1;" "kMinimumDonateLevel = ${toString donateLevel};"
|
|
'';
|
|
|
|
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 ];
|
|
};
|
|
}
|