From d33b7b3faa9c296a3439dbe3a9d6132e7436e8b7 Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 4 Sep 2025 04:49:00 +0200 Subject: Add alternative BitTorrent client service (qBittorrent) Signed-off-by: Mel --- services/torrent/transmission.nix | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 services/torrent/transmission.nix (limited to 'services/torrent/transmission.nix') diff --git a/services/torrent/transmission.nix b/services/torrent/transmission.nix new file mode 100644 index 0000000..e563e3f --- /dev/null +++ b/services/torrent/transmission.nix @@ -0,0 +1,52 @@ +{ + me, + config, + lib, + pkgs, + auxiliaryPkgs, + ... +}: + +let + inherit (pkgs) dockerTools; + inherit (auxiliaryPkgs) common; + + transmission = pkgs.transmission_4; + + torrentLocalPort = 2018; + torrentDir = "/srv/torrent"; + + transmissionImage = dockerTools.streamLayeredImage { + name = "transmission"; + tag = transmission.version; + fromImage = common.alpine.base; + contents = [ transmission ]; + }; +in +{ + foundation.services.torrent = { + image = transmissionImage; + + volumes = [ + [ + "${torrentDir}/transmission" + "/var/lib/transmission/config" + ] + [ + "${torrentDir}/download" + "/var/lib/transmission/download" + ] + ]; + + entrypoint = lib.getExe' transmission "transmission-daemon"; + cmd = [ + "--foreground" + "--port" + "${toString torrentLocalPort}" + "--config-dir" + "/var/lib/transmission/config" + ]; + + customNetworkOption = "container:vpn"; + }; +} -- cgit 1.4.1