From 4c95d6f14be1bde2ae9e33d2318bf8e1c8ff8134 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Sat, 9 Mar 2024 20:01:10 +0100 Subject: hosts/ahmed: Add qBittorrent --- hosts/ahmed/torrenting/default.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 hosts/ahmed/torrenting/default.nix (limited to 'hosts/ahmed/torrenting') diff --git a/hosts/ahmed/torrenting/default.nix b/hosts/ahmed/torrenting/default.nix new file mode 100644 index 0000000..c49baa6 --- /dev/null +++ b/hosts/ahmed/torrenting/default.nix @@ -0,0 +1,37 @@ +# This module configures the my torrenting setup. It uses qBittorrent over a VPN. +{pkgs, options, config, ...}: let + downloadPath = "/srv/media/"; + + interface = "tun0"; +in { + # Configure the actual qBittorrent service. + services.qbittorrent = { + enable = true; + + openFirewall = true; # TEMP: reverse proxy will cover this instead + + settings = { + BitTorrent = { + # Use the specified download path for finished torrents. + "Session\\DefaultSavePath" = downloadPath; + "Session\\TempPath" = "${config.services.qbittorrent.profile}/qBittorrent/temp"; + "Session\\TempPathEnabled" = true; + }; + + # Instruct qBittorrent to only use VPN interface. + }; + }; + + # Create the directory to which media will be downloaded. + # This is also used by Jellyfin to serve the files. + systemd.tmpfiles.rules = let + user = options.services.qbittorrent.user.default; + group = options.services.qbittorrent.group.default; + in [ + "d ${downloadPath} 0755 ${user} ${group}" + ]; + + # Create a connection to Mullvad's WireGuard server. + + # Use NGINX as a reverse proxy for qBittorrent's WebUI. +} -- cgit v1.2.3