28 enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
32 apparmorRulesFromClosure,
35 stdenv.mkDerivation (finalAttrs: {
36 pname = "transmission";
39 src = fetchFromGitHub {
40 owner = "transmission";
41 repo = "transmission";
42 rev = finalAttrs.version;
43 hash = "sha256-n4iEDt9AstDZPZXN47p13brNLbNWS3BTB+A4UuoEjzE=";
44 fetchSubmodules = true;
48 # fix build with openssl 3.0
49 ./transmission-3.00-openssl-3.patch
50 # fix build with miniupnpc 2.2.8
51 ./transmission-3.00-miniupnpc-2.2.8.patch
61 mkFlag = opt: if opt then "ON" else "OFF";
64 "-DENABLE_MAC=OFF" # requires xcodebuild
65 "-DENABLE_GTK=${mkFlag enableGTK3}"
66 "-DENABLE_QT=${mkFlag enableQt}"
67 "-DENABLE_DAEMON=${mkFlag enableDaemon}"
68 "-DENABLE_CLI=${mkFlag enableCli}"
69 "-DINSTALL_LIB=${mkFlag installLib}"
77 ++ lib.optionals enableGTK3 [ wrapGAppsHook3 ]
78 ++ lib.optionals enableQt [ qt5.wrapQtAppsHook ];
93 ++ lib.optionals enableQt [
97 ++ lib.optionals enableGTK3 [
101 ++ lib.optionals enableSystemd [ systemd ]
102 ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify-tools ]
103 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
107 cat >$apparmor/bin.transmission-daemon <<EOF
108 include <tunables/global>
109 $out/bin/transmission-daemon {
110 include <abstractions/base>
111 include <abstractions/nameservice>
112 include <abstractions/ssl_certs>
114 apparmorRulesFromClosure { name = "transmission-daemon"; } (
124 ++ lib.optionals enableSystemd [ systemd ]
125 ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify-tools ]
128 r @{PROC}/sys/kernel/random/uuid,
129 r @{PROC}/sys/vm/overcommit_memory,
130 r @{PROC}/@{pid}/environ,
131 r @{PROC}/@{pid}/mounts,
132 rwk /tmp/tr_session_id_*,
134 r $out/share/transmission/web/**,
136 include <local/bin.transmission-daemon>
142 apparmor = nixosTests.transmission_3; # starts the service with apparmor enabled
143 smoke-test = nixosTests.bittorrent;
147 description = "Fast, easy and free BitTorrent client (deprecated version 3)";
151 else if enableGTK3 then
156 Transmission is a BitTorrent client which features a simple interface
157 on top of a cross-platform back-end.
159 * Uses fewer resources than other clients
160 * Native Mac, GTK and Qt GUI clients
161 * Daemon ideal for servers, embedded systems, and headless use
162 * All these can be remote controlled by Web and Terminal clients
163 * Bluetack (PeerGuardian) blocklists with automatic updates
164 * Full encryption, DHT, and PEX support
166 homepage = "http://www.transmissionbt.com/";
167 license = lib.licenses.gpl2Plus; # parts are under MIT
168 maintainers = with lib.maintainers; [ astsmtl ];
169 platforms = lib.platforms.unix;