1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-24 02:46:38 +00:00
nixpkgs/pkgs/applications/misc/xmrig/default.nix

37 lines
993 B
Nix
Raw Normal View History

2019-08-18 01:01:28 +01:00
{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd, openssl, hwloc
2018-03-28 05:59:30 +01:00
, donateLevel ? 0
}:
stdenv.mkDerivation rec {
pname = "xmrig";
2019-08-18 01:01:28 +01:00
version = "3.0.0";
2018-03-28 05:59:30 +01:00
src = fetchFromGitHub {
owner = "xmrig";
repo = "xmrig";
rev = "v${version}";
2019-08-18 01:01:28 +01:00
sha256 = "1m0rsjb7y1j77mzg5cqb3fdvzgvjkrwgmkjn9nv1xl2757z8hcl4";
2018-03-28 05:59:30 +01:00
};
nativeBuildInputs = [ cmake ];
2019-08-18 01:01:28 +01:00
buildInputs = [ libuv libmicrohttpd openssl hwloc ];
2018-03-28 05:59:30 +01:00
postPatch = ''
2019-02-11 22:26:21 +00:00
substituteInPlace src/donate.h \
--replace "kDefaultDonateLevel = 5;" "kDefaultDonateLevel = ${toString donateLevel};" \
--replace "kMinimumDonateLevel = 1;" "kMinimumDonateLevel = ${toString donateLevel};"
2018-03-28 05:59:30 +01: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 09:12:13 +01:00
platforms = [ "x86_64-linux" "x86_64-darwin" ];
2019-08-18 01:01:28 +01:00
maintainers = with maintainers; [ fpletz kim0 ];
2018-03-28 05:59:30 +01:00
};
}