feat: minecraft server (trust me)

This commit is contained in:
s-prechtl 2025-03-29 18:31:24 +01:00
parent 6d284dac15
commit 297fe67d61

View file

@ -1,84 +1,29 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ {
config, config,
lib, lib,
pkgs, pkgs,
inputs,
... ...
}: { }: let
inherit (lib) concatStringsSep;
in {
imports = [ imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
inputs.mms.module
]; ];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "hitsugibune"; # Define your hostname. networking.hostName = "hitsugibune";
# Pick only one of the below networking options. time.timeZone = "Europe/Vienna";
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
# time.timeZone = "Europe/Amsterdam";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# hardware.pulseaudio.enable = true;
# OR
# services.pipewire = {
# enable = true;
# pulse.enable = true;
# };
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
# users.users.alice = {
# isNormalUser = true;
# extraGroups = [ "wheel" ]; # Enable sudo for the user.
# packages = with pkgs; [
# tree
# ];
# };
# programs.firefox.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vim vim
wget wget
git git
]; ];
# List services that you want to enable:
services.openssh = { services.openssh = {
enable = true; enable = true;
settings = { settings = {
@ -89,33 +34,48 @@
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = ["nix-command" "flakes"];
# Open ports in the firewall. services.modded-minecraft-servers = {
# networking.firewall.allowedTCPPorts = [ ... ]; # This is mandatory, sorry.
# networking.firewall.allowedUDPPorts = [ ... ]; eula = true;
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system # The name will be used for the state folder and system user.
# (/run/current-system/configuration.nix). This is useful in case you # In this case, the folder is `/var/lib/mc-aged`
# accidentally delete configuration.nix. # and the user `mc-aged`.
# system.copySystemConfiguration = true; aged = {
enable = true;
jvmMaxAllocation = "12G";
jvmInitialAllocation = "2G";
jvmOpts = concatStringsSep " " [
"-XX:+UseG1GC"
"-XX:+ParallelRefProcEnabled"
"-XX:MaxGCPauseMillis=200"
"-XX:+UnlockExperimentalVMOptions"
"-XX:+DisableExplicitGC"
"-XX:+AlwaysPreTouch"
"-XX:G1NewSizePercent=40"
"-XX:G1MaxNewSizePercent=50"
"-XX:G1HeapRegionSize=16M"
"-XX:G1ReservePercent=15"
"-XX:G1HeapWastePercent=5"
"-XX:G1MixedGCCountTarget=4"
"-XX:InitiatingHeapOccupancyPercent=20"
"-XX:G1MixedGCLiveThresholdPercent=90"
"-XX:G1RSetUpdatingPauseTimePercent=5"
"-XX:SurvivorRatio=32"
"-XX:+PerfDisableSharedMem"
"-XX:MaxTenuringThreshold=1"
];
# This option defines the first version of NixOS you have installed on this particular machine, serverConfig = {
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. server-port = 25566;
# motd = "SIB24 Aged Server";
# Most users should NEVER change this value after the initial install, for any reason, white-list = true;
# even if you've upgraded your system to a new NixOS release. spawn-protection = 0;
# max-tick-time = 5 * 60 * 1000;
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from, allow-flight = true;
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how };
# to actually do that. };
# };
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable. system.stateVersion = "24.11";
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.11"; # Did you read the comment?
} }