{ config, inputs, pkgs, ... }: let inherit (config.poz.other.system) username; in { imports = [ inputs.nix-minecraft.nixosModules.minecraft-servers ]; nixpkgs.overlays = [ inputs.nix-minecraft.overlay ]; users.users.${username} = { extraGroups = [ "minecraft" ]; }; services.minecraft-servers = { enable = true; eula = true; dataDir = "/var/lib/minecraft"; servers.celestynow = { enable = true; autoStart = true; openFirewall = true; enableReload = true; serverProperties = { server-ip = "127.0.0.1"; server-port = 25565; difficulty = 3; gamemode = 0; enable-command-block = true; hide-online-players = true; level-name = "swiat"; motd = "dupa"; max-players = 4; online-mode = false; snooper-enabled = false; spawn-protection = 0; view-distance = 12; # white-list = true; # enforce-whitelist = true; }; # whitelist = { # jacekpoz = "8cc45dd9-0145-4068-be30-038a3844ebd0"; # emo_mruczek = "e62cfed1-4758-488e-ac91-b623a87e0ac9"; # }; package = pkgs.vanillaServers.vanilla-1_21; jvmOpts = "-Xms6144M -Xmx8192M"; # symlinks = { # mods = pkgs.linkFarmFromDrvs "mods" (builtins.attrValues { # Create-Fabric = pkgs.fetchurl { # url = "https://cdn.modrinth.com/data/Xbc0uyRg/versions/h2HgGyvA/create-fabric-0.5.1-f-build.1417%2Bmc1.20.1.jar"; # sha512 = "bc8e3afc219ecf9d475f4b56f421024f76fc20bce941a2c956ecca1e8905b39d946a124aca48cb391a0a60314d68fd5413c8c12d0ad1f605159b10611595878f"; # }; # Fabric-Api = pkgs.fetchurl { # url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/YG53rBmj/fabric-api-0.92.0%2B1.20.1.jar"; # sha512 = "53ce4cb2bb5579cef37154c928837731f3ae0a3821dd2fb4c4401d22d411f8605855e8854a03e65ea4f949dfa0e500ac1661a2e69219883770c6099b0b28e4fa"; # }; # }); # }; }; }; # services.caddy = { # enable = true; # virtualHosts."mc.jacekpoz.pl:2137".extraConfig = '' # reverse_proxy * localhost:25565 # ''; # }; networking.firewall.allowedTCPPorts = [ 25565 ]; }