mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-09 20:16:16 +03:00
nixos/home-assistant: fix openFirewall
This commit is contained in:
parent
5ddae4097c
commit
ccf42c7987
1 changed files with 8 additions and 1 deletions
|
@ -360,7 +360,14 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ];
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = cfg.openFirewall -> !isNull cfg.config;
|
||||||
|
message = "openFirewall can only be used with a declarative config";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.config.http.server_port ];
|
||||||
|
|
||||||
systemd.services.home-assistant = {
|
systemd.services.home-assistant = {
|
||||||
description = "Home Assistant";
|
description = "Home Assistant";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue