use native qbittorrent

This commit is contained in:
2024-11-13 10:04:33 -05:00
parent eeb4dfae7a
commit 2c245e1425
4 changed files with 65 additions and 48 deletions

View File

@@ -13,56 +13,14 @@
./hardware.nix
./services/jellyfin.nix
./services/caddy.nix
./services/quadlet.nix
# ./services/quadlet.nix
./services/immich.nix
./services/gitea.nix
./services/minecraft.nix
# ./services/llm.nix
# ./services/soulseek.nix
./services/qbittorrent.nix
];
# vpnNamespaces.wg = {
# enable = true;
# wireguardConfigFile = ./secrets/wg0.conf;
# accessibleFrom = [
# # "192.168.1.0/24"
# # "127.0.0.1"
# "0.0.0.0/32"
# ];
# # portMappings = [
# # {
# # from = config.services.qbittorrent.webuiPort;
# # to = config.services.qbittorrent.webuiPort;
# # }
# # ];
# openVPNPorts = [
# {
# port = config.services.qbittorrent.webuiPort;
# protocol = "tcp";
# }
# ];
# };
# services.qbittorrent = {
# enable = true;
# openFirewall = true;
# package = pkgs.qbittorrent-nox;
# webuiPort = service_configs.ports.torrent;
# serverConfig.LegalNotice.Accepted = true;
# serverConfig.Preferences.WebUI = {
# AlternativeUIEnabled = true;
# RootFolder = "${pkgs.fetchzip {
# url = "https://github.com/VueTorrent/VueTorrent/releases/download/v2.17.0/vuetorrent.zip";
# hash = "sha256-PpumQCgIZp9wENL1XZvf7CdUAW9W0pQP5wqtG9oOUpM=";
# }}";
# };
# };
# systemd.services.qbittorrent.vpnConfinement = {
# enable = true;
# vpnNamespace = "wg";
# };
systemd.targets = {
sleep.enable = false;
suspend.enable = false;

6
flake.lock generated
View File

@@ -74,11 +74,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1731433909,
"narHash": "sha256-uB4TW3PP9ZC85OjbNV3n5VPAFEdJ5852erzlaE9+vSs=",
"lastModified": 1731474235,
"narHash": "sha256-wcteA0D0PKmULhuHKhIsnXpngAAmbMMrWxvGwi/eITM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ef9b4bce3e4829beefebc2246d08517732fbffbf",
"rev": "1641c8d30380e2507a5ccff8f4a4800311bdfe5a",
"type": "github"
},
"original": {

View File

@@ -12,7 +12,7 @@
tls ${service_configs.https.certs}/cert.crt ${service_configs.https.certs}/cert.key
handle_path /torrent* {
reverse_proxy 127.0.0.1:${builtins.toString service_configs.ports.torrent}
reverse_proxy 192.168.15.1:${builtins.toString service_configs.ports.torrent}
}
root * ${service_configs.https.data_dir}

59
services/qbittorrent.nix Normal file
View File

@@ -0,0 +1,59 @@
{
pkgs,
config,
service_configs,
...
}:
{
# network namespace that is proxied through mullvad
vpnNamespaces.wg = {
enable = true;
wireguardConfigFile = ./secrets/wg0.conf;
accessibleFrom = [
"192.168.0.0/24"
];
portMappings = [
{
from = config.services.qbittorrent.webuiPort;
to = config.services.qbittorrent.webuiPort;
}
];
openVPNPorts = [
{
port = config.services.qbittorrent.webuiPort;
protocol = "both";
}
];
};
services.qbittorrent = {
enable = true;
package = pkgs.qbittorrent-nox;
webuiPort = service_configs.ports.torrent;
serverConfig.LegalNotice.Accepted = true;
serverConfig.Preferences.WebUI = {
AlternativeUIEnabled = true;
RootFolder = "${pkgs.fetchzip {
url = "https://github.com/VueTorrent/VueTorrent/releases/download/v2.17.0/vuetorrent.zip";
hash = "sha256-PpumQCgIZp9wENL1XZvf7CdUAW9W0pQP5wqtG9oOUpM=";
}}";
Password_PBKDF2 = "@ByteArray(U6PmgkmajHD6Nu5rLbazHw==:ycEEnAMGTxwAhkFiQtdkc6mbGArmnZ2Tkujk6wt4CCytlX0mzGgjQVLKzRb8vSV/S1Yu6+PuAO5gC8IxGR97jA==)";
};
serverConfig.Preferences.Downloads = {
SavePath = service_configs.hdd_path + "/torrents";
TempPath = service_configs.hdd_path + "/torrents/incomplete";
};
serverConfig.BitTorrent.Session = {
GlobalUPSpeedLimit = 1000; # 1 MiB/s
QueueingSystemEnabled = false; # seed all torrents all the time
};
};
# make qbittorrent use a vpn
systemd.services.qbittorrent.vpnConfinement = {
enable = true;
vpnNamespace = "wg";
};
}