135 current 2025-10-08 22:40:45 25.05.20251006.20c4598 6.12.50 *

This commit is contained in:
2025-10-08 23:00:15 -05:00
parent 34397fbb50
commit e012243194
2 changed files with 15 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# flake for blakes nixos config # flake for blakes nixos config
# define new devices in outputs # define new devices in outputs
# generation: 134 current 2025-10-08 22:40:11 25.05.20251006.20c4598 6.12.50 * # generation: 135 current 2025-10-08 22:40:45 25.05.20251006.20c4598 6.12.50 *
{ {
description = "blakes nix config"; description = "blakes nix config";
inputs = { inputs = {

View File

@@ -2,9 +2,10 @@
let let
cfg = config.modules.services.qbittorrent; cfg = config.modules.services.qbittorrent;
ids = 2003;
default_port = 8080; default_port = 8080;
data_dir = "/var/lib/qBittorrent"; data_dir = "/var/lib/qBittorrent";
ids = 2003;
vpn_inf = "enp89s0.69"; # vpn interfacve
in in
{ {
options.modules.services.qbittorrent = { options.modules.services.qbittorrent = {
@@ -49,22 +50,31 @@ in
profileDir = data_dir; profileDir = data_dir;
webuiPort = cfg.port; webuiPort = cfg.port;
# torrentingPort = cfg.port; # torrentingPort = cfg.port;
}; };
# override umask to make permissions work out # override umask to make permissions work out
systemd.services.qbittorrent = { systemd.services.qbittorrent = {
serviceConfig = { serviceConfig = {
UMask = lib.mkForce "0007"; UMask = lib.mkForce "0007";
# User = "qbittorrent";
# Group = "qbittorrent";
}; };
networking.firewall.extraCommands = ''
# qbittorrent kill switch for uid ${toString ids}
iptables -N QBIT
iptables -A OUTPUT -m owner --uid-owner ${toString ids} -j QBIT
iptables -A QBIT -o ${vpn_inf} -j ACCEPT
iptables -A QBIT -j DROP
'';
# ------------------------------------------------------------------------------
# # add systemd service to VPN network namespace # # add systemd service to VPN network namespace
# vpnConfinement = { # vpnConfinement = {
# enable = true; # enable = true;
# vpnNamespace = "wgmex"; # vpnNamespace = "wgmex";
# }; # };
# ------------------------------------------------------------------------------
}; };
# # open firewall # # open firewall