modules#qbittorrent: add openFirewall
option
This commit is contained in:
parent
af861dd0f8
commit
45edaf673c
|
@ -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";
|
||||||
|
|
|
@ -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" ];
|
||||||
|
|
Loading…
Reference in a new issue