1 { lib, stdenv, fetchFromGitHub, cmake, pkg-config
2 , boost, miniupnpc, openssl, unbound
3 , zeromq, pcsclite, readline, libsodium, hidapi
5 , CoreData, IOKit, PCSC
6 , trezorSupport ? true, libusb1, protobuf, python3
11 supercop = fetchFromGitHub {
12 owner = "monero-project";
14 rev = "633500ad8c8759995049ccd022107d1fa8a1bbc9";
15 hash = "sha256-26UmESotSWnQ21VbAYEappLpkEMyl0jiuCaezRYd/sE=";
17 trezor-common = fetchFromGitHub {
19 repo = "trezor-common";
20 rev = "bc28c316d05bf1e9ebfe3d7df1ab25831d98d168";
21 hash = "sha256-F1Hf1WwHqXMd/5OWrdkpomszACTozDuC7DQXW3p6248=";
26 stdenv.mkDerivation rec {
30 src = fetchFromGitHub {
31 owner = "monero-project";
34 hash = "sha256-1LkKIrud317BEE+713t5wiJV6FcDlJdj4ypXPR0bKTs=";
38 ./use-system-libraries.patch
42 # manually install submodules
43 rmdir external/{supercop,trezor-common}
44 ln -sf ${supercop} external/supercop
45 ln -sf ${trezor-common} external/trezor-common
46 # export patched source for monero-gui
50 nativeBuildInputs = [ cmake pkg-config ];
53 boost miniupnpc openssl unbound
54 zeromq pcsclite readline
55 libsodium hidapi randomx rapidjson
57 ] ++ lib.optionals stdenv.isDarwin [ IOKit CoreData PCSC ]
58 ++ lib.optionals trezorSupport [ libusb1 protobuf python3 ];
61 "-DUSE_DEVICE_TREZOR=ON"
63 "-DReadline_ROOT_DIR=${readline.dev}"
64 "-DRandomX_ROOT_DIR=${randomx}"
65 ] ++ lib.optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF";
67 outputs = [ "out" "source" ];
70 description = "Private, secure, untraceable currency";
71 homepage = "https://getmonero.org/";
72 license = licenses.bsd3;
73 platforms = platforms.all;
74 maintainers = with maintainers; [ rnhmjoj ];
75 mainProgram = "monero-wallet-cli";