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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.2 KiB
Nix
Raw Normal View History

2023-02-09 05:51:55 +00:00
{ stdenv
, lib
, fetchFromGitHub
, cmake
, libuv
, libmicrohttpd
, openssl
, hwloc
2018-03-28 04:59:30 +00:00
, donateLevel ? 0
2023-02-09 05:51:55 +00:00
, darwin
2018-03-28 04:59:30 +00:00
}:
2023-02-09 05:51:55 +00:00
let
inherit (darwin.apple_sdk_11_0.frameworks) Carbon CoreServices OpenCL;
in
2018-03-28 04:59:30 +00:00
stdenv.mkDerivation rec {
pname = "xmrig";
2023-03-30 03:21:28 +00:00
version = "6.19.1";
2018-03-28 04:59:30 +00:00
src = fetchFromGitHub {
owner = "xmrig";
repo = "xmrig";
rev = "v${version}";
2023-03-30 03:21:28 +00:00
hash = "sha256-m8ot/IbpxdzHOyJymzZ7MWt4p78GTUuTjYZ9P1oGpWI=";
2018-03-28 04:59:30 +00:00
};
2023-02-09 05:51:55 +00:00
patches = [
./donate-level.patch
];
2018-03-28 04:59:30 +00:00
postPatch = ''
2021-05-07 16:50:51 +00:00
substituteAllInPlace src/donate.h
2023-02-09 05:51:55 +00:00
substituteInPlace cmake/OpenSSL.cmake \
--replace "set(OPENSSL_USE_STATIC_LIBS TRUE)" "set(OPENSSL_USE_STATIC_LIBS FALSE)"
2018-03-28 04:59:30 +00:00
'';
2023-02-09 05:51:55 +00:00
nativeBuildInputs = [
cmake
];
buildInputs = [
libuv
libmicrohttpd
openssl
hwloc
] ++ lib.optionals stdenv.isDarwin [
Carbon
CoreServices
OpenCL
];
inherit donateLevel;
2018-03-28 04:59:30 +00:00
installPhase = ''
2023-02-09 05:51:55 +00:00
runHook preInstall
2018-03-28 04:59:30 +00:00
install -vD xmrig $out/bin/xmrig
2023-02-09 05:51:55 +00:00
runHook postInstall
2018-03-28 04:59:30 +00:00
'';
meta = with lib; {
description = "Monero (XMR) CPU miner";
homepage = "https://github.com/xmrig/xmrig";
license = licenses.gpl3Plus;
2023-02-09 05:51:55 +00:00
platforms = platforms.unix;
maintainers = with maintainers; [ kim0 ];
2018-03-28 04:59:30 +00:00
};
}