Skip to content

Commit

Permalink
nixos/factorio: add openFirewall option
Browse files Browse the repository at this point in the history
  • Loading branch information
Stijn DW authored and erictapen committed Nov 24, 2020
1 parent ae61f8a commit d934344
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions nixos/modules/services/games/factorio.nix
Expand Up @@ -49,8 +49,13 @@ in
default = 34197;
description = ''
The port to which the service should bind.
This option will also open up the UDP port in the firewall configuration.
'';
};
openFirewall = mkOption {
type = types.bool;
default = true;
description = ''
Whether to automatically open the specified UDP port in the firewall.
'';
};
saveName = mkOption {
Expand Down Expand Up @@ -237,6 +242,6 @@ in
};
};

networking.firewall.allowedUDPPorts = [ cfg.port ];
networking.firewall.allowedUDPPorts = if cfg.openFirewall then [ cfg.port ] else [];
};
}

0 comments on commit d934344

Please sign in to comment.