From 852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 22 May 2018 03:14:04 +0200 Subject: [PATCH] home-assistant module: add openFirewall option --- nixos/modules/services/misc/home-assistant.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index 1dc7b44ee37..05555353f20 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -128,9 +128,17 @@ in { you might need to specify it in extraPackages. ''; }; + + openFirewall = mkOption { + default = false; + type = types.bool; + description = "Whether to open the firewall for the specified port."; + }; }; config = mkIf cfg.enable { + networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ]; + systemd.services.home-assistant = { description = "Home Assistant"; after = [ "network.target" ];