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/qbittorrent.nix | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 services/torrent/qbittorrent.nix (limited to 'services/torrent/qbittorrent.nix') diff --git a/services/torrent/qbittorrent.nix b/services/torrent/qbittorrent.nix new file mode 100644 index 0000000..88bacd9 --- /dev/null +++ b/services/torrent/qbittorrent.nix @@ -0,0 +1,49 @@ +{ + lib, + pkgs, + auxiliaryPkgs, + ... +}: + +let + inherit (pkgs) dockerTools; + inherit (auxiliaryPkgs) common; + + qbittorrent = pkgs.qbittorrent-nox; + + torrentLocalPort = 2018; + torrentDir = "/srv/torrent"; + + qbittorrentImage = dockerTools.streamLayeredImage { + name = "qbittorrent"; + tag = qbittorrent.version; + fromImage = common.alpine.base; + contents = [ qbittorrent ]; + }; +in +{ + foundation.services.torrent = { + image = qbittorrentImage; + + volumes = [ + [ + "${torrentDir}/qbittorrent" + "/qbittorrent/config" + ] + [ + "${torrentDir}/download" + "/qbittorrent/download" + ] + ]; + + entrypoint = lib.getExe qbittorrent; + cmd = [ + "--confirm-legal-notice" + "--profile=/qbittorrent/config" + + "--webui-port=${toString torrentLocalPort}" + ]; + + customNetworkOption = "container:vpn"; + }; +} -- cgit 1.4.1