diff --git a/nixos/modules/services/networking/crab-hole.nix b/nixos/modules/services/networking/crab-hole.nix index 31af31e7a225..47cb35066d30 100644 --- a/nixos/modules/services/networking/crab-hole.nix +++ b/nixos/modules/services/networking/crab-hole.nix @@ -35,6 +35,12 @@ in package = lib.mkPackageOption pkgs "crab-hole" { }; + openFirewall = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Open ports in the firewall for crab-hole's DNS server."; + }; + supplementaryGroups = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ ]; @@ -170,6 +176,11 @@ in RestartSec = 1; }; }; + + networking.firewall = lib.mkIf cfg.openFirewall { + allowedUDPPorts = [ 53 ]; + allowedTCPPorts = [ 53 ]; + }; }; meta.maintainers = [