From 6718b04e13563ced9be8a616d85187ac0d384583 Mon Sep 17 00:00:00 2001 From: Fatih Altinok Date: Thu, 23 Jul 2026 23:00:57 +0300 Subject: [PATCH] nixos/crab-hole: Add `openFirewall` option to `services.crab-hole` Add `openFirewall` option similar to pi-hole for easier usage. Fixes #542947 --- nixos/modules/services/networking/crab-hole.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 = [