From b651c0fbf47f58a6b1ba0663615832dbc578ebe1 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Mon, 14 Apr 2025 18:08:33 -0700 Subject: migration: zenithproxy --- hosts/copenhagen/configuration.nix | 9 -------- roles/minecraft/default.nix | 8 -------- roles/minecraft/zenith/default.nix | 24 ---------------------- .../nixos/services/minecraft/zenith/default.nix | 21 +++++++++++++++++++ .../systems/x86_64-linux/copenhagen/default.nix | 5 +++++ 5 files changed, 26 insertions(+), 41 deletions(-) delete mode 100644 roles/minecraft/default.nix delete mode 100644 roles/minecraft/zenith/default.nix create mode 100644 snowfall/modules/nixos/services/minecraft/zenith/default.nix 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; + }; }; }; }; -- cgit v1.2.3