aboutsummaryrefslogtreecommitdiff
path: root/roles/minecraft/zenith/default.nix
blob: 29cd88016a7ed59d32207c5a9c4563a118ec3433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ config, lib, pkgs, ... }:
with lib;

let cfg = config.roles.minecraft.zenith; in {
  options.roles.minecraft.zenith = {
    enable = mkEnableOption "zenith proxy role";

    port = mkOption {
      type = types.port;
      default = 25565;
      description = "server port";
    };

    openFirewall = mkOption {
      type = types.bool;
      default = true;
      description = "open firewall";
    };
  };

  config = mkIf cfg.enable {
    networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ];
  };
}