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

47 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, stdenvGcc6, lib
2020-11-28 16:32:00 +00:00
, fetchFromGitHub, cmake, libmicrohttpd_0_9_70, openssl
2017-12-11 03:22:47 +00:00
, opencl-headers, ocl-icd, hwloc, cudatoolkit
2017-12-11 08:42:44 +00:00
, devDonationLevel ? "0.0"
2017-12-12 13:27:49 +00:00
, cudaSupport ? false
2018-03-28 04:54:22 +00:00
, openclSupport ? true
2017-12-11 03:22:47 +00:00
}:
let
stdenv' = if cudaSupport then stdenvGcc6 else stdenv;
in
stdenv'.mkDerivation rec {
2017-12-11 03:22:47 +00:00
name = "xmr-stak-${version}";
2019-12-10 02:07:07 +00:00
version = "2.10.8";
2017-12-11 03:22:47 +00:00
src = fetchFromGitHub {
owner = "fireice-uk";
repo = "xmr-stak";
2019-09-08 23:38:31 +00:00
rev = version;
2019-12-10 02:07:07 +00:00
sha256 = "0ilx5mhh91ks7dwvykfyynh53l6vkkignjpwkkss8ss6b2k8gdbj";
2017-12-11 03:22:47 +00:00
};
NIX_CFLAGS_COMPILE = "-O3";
2017-12-12 13:27:49 +00:00
cmakeFlags = lib.optional (!cudaSupport) "-DCUDA_ENABLE=OFF"
++ lib.optional (!openclSupport) "-DOpenCL_ENABLE=OFF";
2017-12-11 03:22:47 +00:00
nativeBuildInputs = [ cmake ];
2020-11-28 16:32:00 +00:00
buildInputs = [ libmicrohttpd_0_9_70 openssl hwloc ]
2017-12-12 13:27:49 +00:00
++ lib.optional cudaSupport cudatoolkit
++ lib.optionals openclSupport [ opencl-headers ocl-icd ];
2017-12-11 03:22:47 +00:00
postPatch = ''
substituteInPlace xmrstak/donate-level.hpp \
2017-12-11 08:42:44 +00:00
--replace 'fDevDonationLevel = 2.0' 'fDevDonationLevel = ${devDonationLevel}'
2017-12-11 03:22:47 +00:00
'';
meta = with lib; {
description = "Unified All-in-one Monero miner";
homepage = "https://github.com/fireice-uk/xmr-stak";
license = licenses.gpl3Plus;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ fpletz bfortz ];
2017-12-11 03:22:47 +00:00
};
}