diff --git a/modules/services/torrent/qbittorrent.nix b/modules/services/torrent/qbittorrent.nix index 4c3d1ad5..8f9f45ca 100644 --- a/modules/services/torrent/qbittorrent.nix +++ b/modules/services/torrent/qbittorrent.nix @@ -47,6 +47,14 @@ in ''; }; + openFirewall = mkOption { + type = types.bool; + default = false; + description = '' + Open services.qBittorrent.port to the outside network. + ''; + }; + openFilesLimit = mkOption { default = openFilesLimit; description = '' @@ -67,6 +75,11 @@ in ) ]; + networking.firewall = mkIf cfg.openFirewall { + allowedTCPPorts = [ cfg.port ]; + allowedUDPPorts = [ cfg.port ]; + }; + systemd.services.qbittorrent = { after = [ "network.target" ]; description = "qBittorrent Daemon"; diff --git a/profiles/misc/torrent.nix b/profiles/misc/torrent.nix index 3337af21..6bebe2d9 100644 --- a/profiles/misc/torrent.nix +++ b/profiles/misc/torrent.nix @@ -7,6 +7,7 @@ in services.qbittorrent = { enable = true; group = "media"; + openFirewall = true; }; users.groups.media.members = [ "qbittorrent" ];