aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hosts/copenhagen/configuration.nix6
-rw-r--r--roles/minecraft/default.nix1
-rw-r--r--roles/minecraft/zenith/default.nix24
3 files changed, 31 insertions, 0 deletions
diff --git a/hosts/copenhagen/configuration.nix b/hosts/copenhagen/configuration.nix
index 513c72b..f66a1a9 100644
--- a/hosts/copenhagen/configuration.nix
+++ b/hosts/copenhagen/configuration.nix
@@ -64,12 +64,18 @@
roles = {
minecraft = {
enable = true;
+
servers = {
stargazers = {
enable = true;
port = 25566;
};
};
+
+ zenith = {
+ enable = true;
+ port = 25569;
+ };
};
web = {
images.enable = true;
diff --git a/roles/minecraft/default.nix b/roles/minecraft/default.nix
index 6a43740..7cbc474 100644
--- a/roles/minecraft/default.nix
+++ b/roles/minecraft/default.nix
@@ -4,6 +4,7 @@ with lib;
let cfg = config.roles.minecraft; in {
imports = [
./servers
+ ./zenith
];
options.roles.minecraft = {
diff --git a/roles/minecraft/zenith/default.nix b/roles/minecraft/zenith/default.nix
new file mode 100644
index 0000000..29cd880
--- /dev/null
+++ b/roles/minecraft/zenith/default.nix
@@ -0,0 +1,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 ];
+ };
+}