home-assistant module: add openFirewall option
This commit is contained in:
parent
72f293aa50
commit
852fa6b86f
|
@ -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" ];
|
||||
|
|
Loading…
Reference in New Issue