aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2025-04-14 18:08:33 -0700
committerCaroline Larimore <caroline@larimo.re>2025-04-14 18:58:54 -0700
commitb651c0fbf47f58a6b1ba0663615832dbc578ebe1 (patch)
tree97a9a2fb16acd08709e1a1b7e4b00465c77b3564
parent8d2172fc5b62024414526b28d614ed85842efef7 (diff)
migration: zenithproxy
-rw-r--r--hosts/copenhagen/configuration.nix9
-rw-r--r--roles/minecraft/default.nix8
-rw-r--r--roles/minecraft/zenith/default.nix24
-rw-r--r--snowfall/modules/nixos/services/minecraft/zenith/default.nix21
-rw-r--r--snowfall/systems/x86_64-linux/copenhagen/default.nix5
5 files changed, 26 insertions, 41 deletions
diff --git a/hosts/copenhagen/configuration.nix b/hosts/copenhagen/configuration.nix
index 398cb7b..0b4e83e 100644
--- a/hosts/copenhagen/configuration.nix
+++ b/hosts/copenhagen/configuration.nix
@@ -15,15 +15,6 @@
};
};
- roles = {
- minecraft = {
- zenith = {
- enable = true;
- port = 25569;
- };
- };
- };
-
programs = {
gnupg.agent = {
enable = true;
diff --git a/roles/minecraft/default.nix b/roles/minecraft/default.nix
deleted file mode 100644
index 65c4eea..0000000
--- a/roles/minecraft/default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ config, lib, inputs, ... }:
-with lib;
-
-let cfg = config.roles.minecraft; in {
- imports = [
- ./zenith
- ];
-}
diff --git a/roles/minecraft/zenith/default.nix b/roles/minecraft/zenith/default.nix
deleted file mode 100644
index 29cd880..0000000
--- a/roles/minecraft/zenith/default.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ 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 ];
- };
-}
diff --git a/snowfall/modules/nixos/services/minecraft/zenith/default.nix b/snowfall/modules/nixos/services/minecraft/zenith/default.nix
new file mode 100644
index 0000000..0bc19f7
--- /dev/null
+++ b/snowfall/modules/nixos/services/minecraft/zenith/default.nix
@@ -0,0 +1,21 @@
+{ options, config, lib, pkgs, namespace, ... }:
+
+#TODO: nix-ify zenithproxy
+with lib; with lib.${namespace}; let
+ cfg = config.${namespace}.services.minecraft.zenith;
+ impermanence = config.${namespace}.system.impermanence;
+in {
+ options.${namespace}.services.minecraft.zenith = with types; {
+ enable = mkEnableOption "zenithproxy server";
+
+ port = mkOption {
+ type = types.port;
+ default = 25565;
+ description = "server port";
+ };
+ };
+
+ config = mkIf cfg.enable {
+ networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ];
+ };
+}
diff --git a/snowfall/systems/x86_64-linux/copenhagen/default.nix b/snowfall/systems/x86_64-linux/copenhagen/default.nix
index 4aca131..b980271 100644
--- a/snowfall/systems/x86_64-linux/copenhagen/default.nix
+++ b/snowfall/systems/x86_64-linux/copenhagen/default.nix
@@ -28,6 +28,11 @@ with lib; with lib.${namespace}; {
enable = true;
port = 25566;
};
+
+ zenith = {
+ enable = true;
+ port = 25569;
+ };
};
};
};