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 {
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";

View file

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