nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 SDL2,
4 cmake,
5 enet,
6 extra-cmake-modules,
7 fetchFromGitHub,
8 faad2,
9 libGL,
10 libarchive,
11 libpcap,
12 libslirp,
13 pipewire,
14 pkg-config,
15 qt6,
16 stdenv,
17 unstableGitUpdater,
18 wayland,
19 zstd,
20}:
21
22let
23 inherit (qt6)
24 qtbase
25 qtmultimedia
26 qtwayland
27 wrapQtAppsHook
28 ;
29in
30stdenv.mkDerivation (finalAttrs: {
31 pname = "melonDS";
32 version = "1.0-unstable-2025-11-06";
33
34 src = fetchFromGitHub {
35 owner = "melonDS-emu";
36 repo = "melonDS";
37 rev = "220b238ec06692ee144bb1f50867a2edb8795de1";
38 hash = "sha256-Vnrg+6fSnzQKy+3ZU6LKSkkgc04H9KPsE/M2Iu9Wudw=";
39 };
40
41 nativeBuildInputs = [
42 cmake
43 extra-cmake-modules
44 pkg-config
45 wrapQtAppsHook
46 ];
47
48 buildInputs = [
49 SDL2
50 enet
51 faad2
52 libarchive
53 libslirp
54 libGL
55 qtbase
56 qtmultimedia
57 zstd
58 ]
59 ++ lib.optionals stdenv.hostPlatform.isLinux [
60 wayland
61 qtwayland
62 ];
63
64 cmakeFlags = [ (lib.cmakeBool "USE_QT6" true) ];
65
66 strictDeps = true;
67
68 qtWrapperArgs =
69 lib.optionals stdenv.hostPlatform.isLinux [
70 "--prefix LD_LIBRARY_PATH : ${
71 lib.makeLibraryPath [
72 libpcap
73 pipewire
74 wayland
75 ]
76 }"
77 ]
78 ++ lib.optionals stdenv.hostPlatform.isDarwin [
79 "--prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpcap ]}"
80 ];
81
82 passthru = {
83 updateScript = unstableGitUpdater { };
84 };
85
86 meta = {
87 homepage = "https://melonds.kuribo64.net/";
88 description = "Work in progress Nintendo DS emulator";
89 longDescription = ''
90 melonDS aims at providing fast and accurate Nintendo DS emulation. While
91 it is still a work in progress, it has a pretty solid set of features:
92
93 - Nearly complete core (CPU, video, audio, ...)
94 - JIT recompiler for fast emulation
95 - OpenGL renderer, 3D upscaling
96 - RTC, microphone, lid close/open
97 - Joystick support
98 - Savestates
99 - Various display position/sizing/rotation modes
100 - (WIP) Wifi: local multiplayer, online connectivity
101 - (WIP) DSi emulation
102 - DLDI
103 - (WIP) GBA slot add-ons
104 - and more are planned!
105 '';
106 license = with lib.licenses; [ gpl3Plus ];
107 mainProgram = "melonDS";
108 maintainers = with lib.maintainers; [
109 artemist
110 benley
111 ];
112 platforms = lib.platforms.linux ++ lib.platforms.darwin;
113 };
114})