nixos-config/machines/fuuko/services/torrent.nix
Simon Bruder 4e84140d53
Remove fuuko proxy
It now is directly reachable (over IPv6).
2024-09-08 13:30:18 +02:00

28 lines
767 B
Nix

# SPDX-FileCopyrightText: 2021-2023 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{ lib, ... }:
let
endpoint = lib.splitString ":" (lib.elemAt (import ../secrets/wireguard-qbittorrent.nix).peers 0).endpoint;
endpointAddress = lib.elemAt endpoint 0;
endpointPort = lib.toInt (lib.elemAt endpoint 1);
in
{
sbruder.qbittorrent = {
enable = true;
downloadDir = "/data/hot/torrent";
fqdn = "torrent.sbruder.de";
};
networking.nftables.ruleset = ''
table inet qbittorrent {
chain output {
type filter hook output priority mangle
# AF13 = Class 1 (lowest), high drop probability
ip daddr ${endpointAddress} udp dport ${toString endpointPort} ip dscp set af13
}
}
'';
}