nixpkgs-suyu/pkgs/applications/misc/xmr-stak/default.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

2017-12-11 04:22:47 +01:00
{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd, openssl
, opencl-headers, ocl-icd, hwloc, cudatoolkit
2017-12-11 09:42:44 +01:00
, devDonationLevel ? "0.0"
2017-12-12 14:27:49 +01:00
, cudaSupport ? false
, openclSupport ? false
2017-12-11 04:22:47 +01:00
}:
stdenv.mkDerivation rec {
name = "xmr-stak-${version}";
2017-12-31 12:09:29 +01:00
version = "2.2.0";
2017-12-11 04:22:47 +01:00
src = fetchFromGitHub {
owner = "fireice-uk";
repo = "xmr-stak";
rev = "v${version}";
2017-12-31 12:09:29 +01:00
sha256 = "0n21y37d8khgfk9965mrhnh6y5ag7w0s6as1fmf76yx6vajvajsn";
2017-12-11 04:22:47 +01:00
};
NIX_CFLAGS_COMPILE = "-O3";
2017-12-12 14:27:49 +01:00
cmakeFlags = lib.optional (!cudaSupport) "-DCUDA_ENABLE=OFF"
++ lib.optional (!openclSupport) "-DOpenCL_ENABLE=OFF";
2017-12-11 04:22:47 +01:00
nativeBuildInputs = [ cmake ];
2017-12-12 14:27:49 +01:00
buildInputs = [ libmicrohttpd openssl hwloc ]
++ lib.optional cudaSupport cudatoolkit
++ lib.optionals openclSupport [ opencl-headers ocl-icd ];
2017-12-11 04:22:47 +01:00
postPatch = ''
substituteInPlace xmrstak/donate-level.hpp \
2017-12-11 09:42:44 +01:00
--replace 'fDevDonationLevel = 2.0' 'fDevDonationLevel = ${devDonationLevel}'
2017-12-11 04:22:47 +01:00
'';
meta = with lib; {
description = "Unified All-in-one Monero miner";
homepage = "https://github.com/fireice-uk/xmr-stak";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ fpletz ];
};
}