summaryrefslogtreecommitdiff
path: root/hosts/ahmed
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2024-03-09 20:01:10 +0100
committerLinnnus <[email protected]>2024-04-07 13:41:38 +0200
commit4c95d6f14be1bde2ae9e33d2318bf8e1c8ff8134 (patch)
tree5204448d084ddf28ea511c07d5785cf5b837742b /hosts/ahmed
parent7dac2d7245bc475ac0e8aa0ad4b41f3aa98f39f6 (diff)
hosts/ahmed: Add qBittorrent
Diffstat (limited to 'hosts/ahmed')
-rw-r--r--hosts/ahmed/configuration.nix1
-rw-r--r--hosts/ahmed/hellohtml.linus.onl/default.nix2
-rw-r--r--hosts/ahmed/torrenting/default.nix37
3 files changed, 39 insertions, 1 deletions
diff --git a/hosts/ahmed/configuration.nix b/hosts/ahmed/configuration.nix
index 27c35eb..9d49d32 100644
--- a/hosts/ahmed/configuration.nix
+++ b/hosts/ahmed/configuration.nix
@@ -17,6 +17,7 @@
./linus.onl
./nofitications.linus.onl
./ssh
+ ./torrenting
./home
];
diff --git a/hosts/ahmed/hellohtml.linus.onl/default.nix b/hosts/ahmed/hellohtml.linus.onl/default.nix
index 4859ed3..f973c11 100644
--- a/hosts/ahmed/hellohtml.linus.onl/default.nix
+++ b/hosts/ahmed/hellohtml.linus.onl/default.nix
@@ -20,7 +20,7 @@ in {
];
# Use NGINX as reverse proxy.
- services.nginx.virtualHosts.${mainDomain}= {
+ services.nginx.virtualHosts.${mainDomain} = {
# Set up secondary domain name to also point to this host. Only the
# client (browser) should treat these as separate. On the server, they
# are the same.
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.
+}