From 61ad99783d7a737232f70a010e63cf78d6eaa83f Mon Sep 17 00:00:00 2001 From: Adrian Gunnar Lauterer Date: Sun, 28 Apr 2024 14:42:49 +0200 Subject: [PATCH] minecraft --- machines/elrond/routes.nix | 29 ++++++++++++++++++---------- machines/galadriel/configuration.nix | 1 + services/freshrrs.nix | 2 +- services/mc.nix | 23 ++++++++++++++++++++++ 4 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 services/mc.nix diff --git a/machines/elrond/routes.nix b/machines/elrond/routes.nix index a699166..91ef077 100644 --- a/machines/elrond/routes.nix +++ b/machines/elrond/routes.nix @@ -32,14 +32,23 @@ #basicAuthFile = config.sops.secrets."nginx/defaultpass".path; }; - virtualHosts."jellyfin.lauterer.it" = { - forceSSL = true; - useACMEHost = config.networking.domain; - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://100.84.215.84:8096"; + virtualHosts."jellyfin.lauterer.it" = { + forceSSL = true; + useACMEHost = config.networking.domain; + locations."/" = { + proxyWebsockets = true; + proxyPass = "http://100.84.215.84:8096"; + }; + }; + + virtualHosts."minecraft.256.no" = { + forceSSL = true; + useACMEHost = config.networking.domain; + locations."/" = { + proxyWebsockets = true; + proxyPass = "http://100.84.215.84:25500"; + }; + #basicAuthFile = config.sops.secrets."nginx/defaultpass".path; }; - #basicAuthFile = config.sops.secrets."nginx/defaultpass".path; - }; - }; -} \ No newline at end of file + }; +} diff --git a/machines/galadriel/configuration.nix b/machines/galadriel/configuration.nix index a5bfcea..fb3209b 100644 --- a/machines/galadriel/configuration.nix +++ b/machines/galadriel/configuration.nix @@ -19,6 +19,7 @@ ../../services/smb.nix ../../services/torrent.nix + ../../services/mc.nix #../../services/stableDiffusion.nix #../../services/freshrrs.nix ]; diff --git a/services/freshrrs.nix b/services/freshrrs.nix index b481839..419263f 100644 --- a/services/freshrrs.nix +++ b/services/freshrrs.nix @@ -4,7 +4,7 @@ pkgs.freshrss ]; services.freshrss.enable = true; - services.freshrss.baseUrl = "http://127.0.0.1"; + services.freshrss.baseUrl = "http://0.0.0.1"; services.freshrss.passwordFile = config.sops.secrets."freshrss".path; #"/run/secrets/freshrss"; } \ No newline at end of file diff --git a/services/mc.nix b/services/mc.nix new file mode 100644 index 0000000..ef523c4 --- /dev/null +++ b/services/mc.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: +{ + environment.systemPackages = [ + pkgs.ollama + ]; + + services.minecraft-server = { + enable = true; + eula = true; + jvmOpts = "-Xms4092M -Xmx4092M -XX:+UseG1GC -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10"; + + + serverProperties = { + server-port = 25500; + difficulty = 3; + gamemode = 1; + max-players = 8; + motd = "Adrian Minecraft server!"; + }; + openFirewall = true; + + }; +}