22
0
mirror of https://github.com/SuperSandro2000/nixos-modules.git synced 2024-06-11 10:44:10 +02:00

portunus: only open port when service is enabled

This commit is contained in:
Sandro - 2022-12-22 22:01:28 +01:00
parent 2fa64e5ee1
commit cd89d3b937
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -1,6 +1,6 @@
{ config, lib, ... }:
let
let
cfg = config.services.portunus;
in
{
@ -24,9 +24,10 @@ in
};
};
config = lib.mkIf config.services.portunus.addToHosts {
networking.hosts = {
config = lib.mkIf cfg.enable {
networking.hosts = lib.mkIf cfg.addToHosts {
${cfg.externalIp4} = [ cfg.domain ];
${cfg.externalIp6} = [ cfg.domain ];
};
};
}