2024-01-06 01:19:35 +01:00
|
|
|
# SPDX-FileCopyrightText: 2021-2023 Simon Bruder <simon@sbruder.de>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2023-10-07 22:31:29 +02:00
|
|
|
{ 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
|
2021-02-19 18:35:44 +01:00
|
|
|
{
|
2022-03-18 23:25:05 +01:00
|
|
|
sbruder.qbittorrent = {
|
2021-02-19 18:35:44 +01:00
|
|
|
enable = true;
|
2023-06-28 23:13:57 +02:00
|
|
|
downloadDir = "/data/hot/torrent";
|
2022-03-18 23:25:05 +01:00
|
|
|
fqdn = "torrent.sbruder.de";
|
2021-02-19 18:35:44 +01:00
|
|
|
};
|
2022-10-07 22:19:58 +02:00
|
|
|
|
2023-10-07 22:31:29 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
'';
|
2021-02-19 18:35:44 +01:00
|
|
|
}
|