Home: Replace deluge with transmission.

This commit is contained in:
Dmitry Voronin 2025-01-19 12:39:49 +03:00
parent 445b10976b
commit d76c7aba1e
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
7 changed files with 65 additions and 18 deletions

View file

@ -0,0 +1,15 @@
# Torrent download alias.
function tdl() {
transmission-remote home.local ${@}
}
# Download torrent files to home.
# Usage: tdla <FILES>
function tdla() {
tdl -a "${@}"
}
# List download torrents.
function tdll() {
transmission-remote home.local -l
}

View file

@ -6,7 +6,6 @@ let
(mkBind "change" "/var/lib/changedetection-io")
(mkBind "cups" "/var/lib/cups")
(mkBind "davis" "/var/lib/davis")
(mkBind "deluge" "/var/lib/deluge/.config/deluge")
(mkBind "dkim" "/var/dkim")
(mkBind "dovecot_index" "/var/lib/dovecot/indices")
(mkBind "forgejo" "/var/lib/forgejo")
@ -24,6 +23,7 @@ let
(mkBind "sieve" "/var/sieve")
(mkBind "tandoor" "/var/lib/tandoor-recipes")
(mkBind "terraria" "/var/lib/terraria")
(mkBind "transmission" "/var/lib/transmission")
(mkBind "uptime_kuma" "/var/lib/uptime-kuma")
(mkBind "vaultwarden" "/var/lib/vaultwarden")
(mkBind "vmail" "/var/vmail")

View file

@ -1,12 +0,0 @@
{ lib, ... }:
{
services.deluge = {
enable = true;
web.enable = true;
};
systemd.services.deluged.serviceConfig = {
MemoryMax = "4G";
Restart = lib.mkForce "always";
RuntimeMaxSec = "3h";
};
}

View file

@ -161,10 +161,8 @@ in
ip46tables -I INPUT -j ACCEPT -i ${wan} -p tcp --dport 443
# Deluge torrenting ports.
ip46tables -I INPUT -j ACCEPT -i ${wan} -p tcp --dport 54630
ip46tables -I INPUT -j ACCEPT -i ${wan} -p udp --dport 54630
ip46tables -I INPUT -j ACCEPT -i ${wan} -p tcp --dport 54631
ip46tables -I INPUT -j ACCEPT -i ${wan} -p udp --dport 54631
ip46tables -I INPUT -j ACCEPT -i ${wan} -p tcp --dport 51413
ip46tables -I INPUT -j ACCEPT -i ${wan} -p udp --dport 51413
# Terraria server.
ip46tables -I INPUT -j ACCEPT -i ${wan} -p tcp --dport 22777

View file

@ -0,0 +1,45 @@
{ pkgs, ... }: {
services.transmission = {
enable = true;
package = pkgs.transmission_4;
# REF: https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md
settings = let
downloadDir = "/storage/hot/download";
in
{
bind-address-ipv4 = "0.0.0.0";
bind-address-ipv6 = "::";
cache-size-mb = 4;
dht-enabled = true;
download-dir = downloadDir;
download-queue-enabled = true;
download-queue-size = 10;
encryption = 1;
incomplete-dir-enabled = false;
message-level = 3;
peer-limit-global = 500;
peer-limit-per-torrent = 50;
peer-port = 51413;
pex-enabled = true;
port-forwarding-enabled = false;
preallocation = 1;
preferred-transport = "utp";
rename-partial-files = true;
rpc-bind-address = "::";
rpc-host-whitelist-enabled = false;
rpc-password = "";
rpc-port = 9091;
rpc-username = "root";
rpc-whitelist-enabled = false;
start-added-torrents = true;
tcp-enabled = true;
torrent-added-verify-mode = "fast";
trash-can-enabled = false;
trash-original-torrent-files = true;
umask = 22;
utp-enabled = true;
watch-dir = "/var/lib/transmission/watchdir/";
watch-dir-enabled = true;
};
};
}

View file

@ -6,7 +6,7 @@ in
"download.${cfg.domain}" = {
inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations."/" = {
proxyPass = "http://127.0.0.1:8112$request_uri";
proxyPass = "http://[::1]:9091$request_uri";
extraConfig = cfg.allowLocal;
};
};

View file

@ -102,6 +102,7 @@
swappy # Screenshot editing.
sway # Sway WM.
swaykbdd # Keyboard layout per-window.
transmission_4 # Torrent client.
waybar # Sway bar.
wf-recorder # Screen recording.