summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2018-05-22 03:14:04 +0200
committerRobin Gloster <mail@glob.in>2018-05-22 14:29:57 +0200
commit852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3 (patch)
tree467e3aca466c91b08c18441dbe2b207803587101 /nixos
parent72f293aa50a4e7425b6b054cc7bea7ec0c4027ad (diff)
downloadnixlib-852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3.tar
nixlib-852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3.tar.gz
nixlib-852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3.tar.bz2
nixlib-852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3.tar.lz
nixlib-852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3.tar.xz
nixlib-852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3.tar.zst
nixlib-852fa6b86fbe9e2ac6434b6b8c0111d4bd9dfad3.zip
home-assistant module: add openFirewall option
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/home-assistant.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix
index 1dc7b44ee37b..05555353f207 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 <literal>extraPackages</literal>.
       '';
     };
+
+    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" ];