modules#qbittorrent: add openFirewall option

This commit is contained in:
Timothy DeHerrera 2020-01-01 16:24:36 -07:00
parent af861dd0f8
commit 45edaf673c
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
2 changed files with 14 additions and 0 deletions

View file

@ -47,6 +47,14 @@ in
''; '';
}; };
openFirewall = mkOption {
type = types.bool;
default = false;
description = ''
Open services.qBittorrent.port to the outside network.
'';
};
openFilesLimit = mkOption { openFilesLimit = mkOption {
default = openFilesLimit; default = openFilesLimit;
description = '' description = ''
@ -67,6 +75,11 @@ in
) )
]; ];
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
allowedUDPPorts = [ cfg.port ];
};
systemd.services.qbittorrent = { systemd.services.qbittorrent = {
after = [ "network.target" ]; after = [ "network.target" ];
description = "qBittorrent Daemon"; description = "qBittorrent Daemon";

View file

@ -7,6 +7,7 @@ in
services.qbittorrent = { services.qbittorrent = {
enable = true; enable = true;
group = "media"; group = "media";
openFirewall = true;
}; };
users.groups.media.members = [ "qbittorrent" ]; users.groups.media.members = [ "qbittorrent" ];