summaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2026-01-12 20:31:03 -0500
committertriethyl <triethylammonium@pm.me>2026-01-12 20:31:03 -0500
commit12e152e6011bad1288df5fab822fb14873c49fcc (patch)
treef65531b4869b08df7ea05c42d8e2c9453d027cc3 /nixos
parent9d865876376e4ba1fe0c8f066c206c1fefc44eb2 (diff)
homelab: added minecraft server module
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/homelab/default.nix1
-rw-r--r--nixos/modules/homelab/games/default.nix5
-rw-r--r--nixos/modules/homelab/games/minecraft.nix63
-rw-r--r--nixos/systems/prodesk-server/system.nix4
4 files changed, 72 insertions, 1 deletions
diff --git a/nixos/modules/homelab/default.nix b/nixos/modules/homelab/default.nix
index 72bbb0e..79e4178 100644
--- a/nixos/modules/homelab/default.nix
+++ b/nixos/modules/homelab/default.nix
@@ -6,6 +6,7 @@ in {
./cloud
./dev
./communications
+ ./games
];
options.homelab = {
enable = lib.mkEnableOption "homelab";
diff --git a/nixos/modules/homelab/games/default.nix b/nixos/modules/homelab/games/default.nix
new file mode 100644
index 0000000..2015500
--- /dev/null
+++ b/nixos/modules/homelab/games/default.nix
@@ -0,0 +1,5 @@
+{...}: {
+ imports = [
+ ./minecraft.nix
+ ];
+}
diff --git a/nixos/modules/homelab/games/minecraft.nix b/nixos/modules/homelab/games/minecraft.nix
new file mode 100644
index 0000000..44c09fb
--- /dev/null
+++ b/nixos/modules/homelab/games/minecraft.nix
@@ -0,0 +1,63 @@
+{ config, lib, pkgs, inputs, ... }: let
+ cfg = config.homelab.games.minecraft;
+in {
+ imports = [ inputs.nix-minecraft.nixosModules.minecraft-servers ];
+
+ options.homelab.games.minecraft.enable = lib.mkEnableOption "minecraft servers";
+
+ config = lib.mkIf cfg.enable {
+ nixpkgs.overlays = [ inputs.nix-minecraft.overlay ];
+ environment.systemPackages = [ pkgs.packwiz ];
+
+ networking.firewall.allowedUDPPorts = [ /*svc*/ 24454 ];
+
+ environment.shellAliases = {
+ "serverconsole" = "${pkgs.tmux} -S /run/minecraft/outremonde.sock";
+ };
+
+ services.minecraft-servers = {
+
+ enable = true;
+ eula = true;
+ openFirewall = true;
+
+ servers = {
+
+ vanilla-1_21_1 = {
+ enable = false;
+ package = pkgs.vanillaServers.vanilla-1_21_1;
+ serverProperties = {
+ server-port = 25566;
+ };
+ };
+
+ fantasy = let
+ modpack = pkgs.fetchPackwizModpack {
+ url = "https://git.culsans.site/fantasy-minecraft-modpack.git/plain/pack.toml";
+ packHash = "sha256-BP1pnXNOkw7jdK6fl2fAVybfO2bD2AyWeLRjrTTsYeI=";
+ };
+ in {
+ enable = true;
+ package = pkgs.fabricServers.fabric-1_20_1;
+ symlinks = {
+ "mods" = "${modpack}/mods";
+ "config/additional-additions-config.json" = "${modpack}/config/additional-additions-config.json";
+ "config/configurabledespawntimer.json5" = "${modpack}/config/configurabledespawntimer.json5";
+ "config/fwaystones/config.json5" = "${modpack}/config/fwaystones/config.json5";
+ "config/simplebackup.json5" = "${modpack}/config/simplebackup.json5";
+ };
+ jvmOpts = "-Xms6144M -Xmx6144M";
+ serverProperties = {
+ level-seed = "-5424614792051443123";
+ allow-flight = true;
+ spawn-protection = 0;
+ max-players = 10;
+ server-port = 25565;
+ difficulty = "normal";
+ motd = ''\u00a7f-------\u00a7d Fantasy\u00a7f ----------\u00a7r\n\u00a7f--\u00a7c Survival\u00a7f ---\u00a7b Multiplayer\u00a7f --'';
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/nixos/systems/prodesk-server/system.nix b/nixos/systems/prodesk-server/system.nix
index 7c5ef30..cf8eb1c 100644
--- a/nixos/systems/prodesk-server/system.nix
+++ b/nixos/systems/prodesk-server/system.nix
@@ -81,7 +81,9 @@
git.enable = true;
};
communications = {
- mattermost.enable = true;
+ };
+ games = {
+ minecraft.enable = true;
};
};
}