1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-01 10:00:56 +00:00
nixpkgs/pkgs/applications/misc/xmr-stak/default.nix
2019-12-15 22:13:29 +00:00

47 lines
1.2 KiB
Nix

{ stdenv, stdenvGcc6, lib
, fetchFromGitHub, cmake, libmicrohttpd, openssl
, opencl-headers, ocl-icd, hwloc, cudatoolkit
, devDonationLevel ? "0.0"
, cudaSupport ? false
, openclSupport ? true
}:
let
stdenv' = if cudaSupport then stdenvGcc6 else stdenv;
in
stdenv'.mkDerivation rec {
name = "xmr-stak-${version}";
version = "2.10.8";
src = fetchFromGitHub {
owner = "fireice-uk";
repo = "xmr-stak";
rev = version;
sha256 = "0ilx5mhh91ks7dwvykfyynh53l6vkkignjpwkkss8ss6b2k8gdbj";
};
NIX_CFLAGS_COMPILE = "-O3";
cmakeFlags = lib.optional (!cudaSupport) "-DCUDA_ENABLE=OFF"
++ lib.optional (!openclSupport) "-DOpenCL_ENABLE=OFF";
nativeBuildInputs = [ cmake ];
buildInputs = [ libmicrohttpd openssl hwloc ]
++ lib.optional cudaSupport cudatoolkit
++ lib.optionals openclSupport [ opencl-headers ocl-icd ];
postPatch = ''
substituteInPlace xmrstak/donate-level.hpp \
--replace 'fDevDonationLevel = 2.0' 'fDevDonationLevel = ${devDonationLevel}'
'';
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 ];
};
}