nixpkgs/pkgs/applications/misc/xmrig/default.nix

34 lines
798 B
Nix
Raw Normal View History

2018-03-28 06:59:30 +02:00
{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd
, donateLevel ? 0
}:
stdenv.mkDerivation rec {
name = "xmrig-${version}";
version = "2.5.2";
src = fetchFromGitHub {
owner = "xmrig";
repo = "xmrig";
rev = "v${version}";
sha256 = "1jc6vzqdl85pmiw5qv9b148kfw4k4wxn90ggylxfpfdv7czamh2c";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ libuv libmicrohttpd ];
postPatch = ''
substituteInPlace src/donate.h --replace "kDonateLevel = 5;" "kDonateLevel = ${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;
maintainers = with maintainers; [ fpletz ];
};
}