From 676315644acad92257d89ec0b23b7c392f1288e0 Mon Sep 17 00:00:00 2001 From: unexplrd Date: Thu, 3 Apr 2025 19:33:45 +0300 Subject: [PATCH] turn poor guy into a minecraft server Signed-off-by: unexplrd --- hosts/eldrid/configuration.nix | 17 +++++++------- hosts/eldrid/minecraft.nix | 23 +++++++++++++++++++ .../eldrid/users/user/home-configuration.nix | 3 ++- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 hosts/eldrid/minecraft.nix diff --git a/hosts/eldrid/configuration.nix b/hosts/eldrid/configuration.nix index a3d8865..aec6d18 100644 --- a/hosts/eldrid/configuration.nix +++ b/hosts/eldrid/configuration.nix @@ -12,9 +12,10 @@ ./services.nix ./sops.nix ./users.nix + ./minecraft.nix ]; - desktop.niri.enable = true; + # desktop.niri.enable = true; locale.ukrainian.enable = true; @@ -25,7 +26,7 @@ opentabletdriver.enable = false; - qmk-vial.enable = true; + # qmk-vial.enable = true; security.basic.enable = true; @@ -40,11 +41,11 @@ time.timeZone = "Europe/Kyiv"; - virtual.libvirt.enable = true; + # virtual.libvirt.enable = true; - wireless = { - wifi.enable = true; - bluetooth.enable = true; - bluetooth.enableBlueman = true; - }; + # wireless = { + # wifi.enable = true; + # bluetooth.enable = true; + # bluetooth.enableBlueman = true; + # }; } diff --git a/hosts/eldrid/minecraft.nix b/hosts/eldrid/minecraft.nix new file mode 100644 index 0000000..41e7258 --- /dev/null +++ b/hosts/eldrid/minecraft.nix @@ -0,0 +1,23 @@ +{ + networking.firewall.allowedTCPPorts = [25565]; + networking.firewall.allowedUDPPorts = [25565]; + virtualisation.oci-containers = { + backend = "podman"; + containers.minecraft = { + image = "docker.io/itzg/minecraft-server:java17-alpine"; + volumes = ["/storage/minecraft:/data"]; + ports = ["25565:25565"]; + environment = { + DIFFICULTY = "easy"; + EULA = "true"; + GUI = "false"; + INIT_MEMORY = "6G"; + MAX_MEMORY = "6G"; + ONLINE_MODE = "false"; + TYPE = "forge"; + VERSION = "1.20.1"; + VIEW_DISTANCE = "8"; + }; + }; + }; +} diff --git a/hosts/eldrid/users/user/home-configuration.nix b/hosts/eldrid/users/user/home-configuration.nix index 93ccd24..189cda2 100644 --- a/hosts/eldrid/users/user/home-configuration.nix +++ b/hosts/eldrid/users/user/home-configuration.nix @@ -1,7 +1,8 @@ -{ +{lib, ...}: { imports = [ ../../../dunamis/users/user/common.nix ../../../dunamis/users/user/programs.nix ../../../dunamis/users/user/flatpak.nix ]; + syncthing.enable = lib.mkDefault false; }