nixos/pihole-ftl: fix openFirewall ports (#424348)

This commit is contained in:
Aleksana
2025-07-15 10:51:41 +08:00
committed by GitHub
2 changed files with 12 additions and 1 deletions
@@ -22,6 +22,7 @@ Example configuration:
{
services.pihole-ftl = {
enable = true;
openFirewallDNS = true;
openFirewallDHCP = true;
queryLogDeleter.enable = true;
lists = [
@@ -56,6 +56,12 @@ in
example = "3";
};
openFirewallDNS = mkOption {
type = types.bool;
default = false;
description = "Open ports in the firewall for pihole-FTL's DNS server.";
};
openFirewallDHCP = mkOption {
type = types.bool;
default = false;
@@ -434,11 +440,15 @@ in
};
networking.firewall = lib.mkMerge [
(mkIf cfg.openFirewallDHCP {
(mkIf cfg.openFirewallDNS {
allowedUDPPorts = [ 53 ];
allowedTCPPorts = [ 53 ];
})
(mkIf cfg.openFirewallDHCP {
allowedUDPPorts = [ 67 ];
})
(mkIf cfg.openFirewallWebserver {
allowedTCPPorts = lib.pipe cfg.settings.webserver.port [
(lib.splitString ",")