minecraft

This commit is contained in:
Vivian 2022-05-05 15:16:37 +02:00
parent aec776d1cb
commit 617b854263
4 changed files with 95 additions and 15 deletions

View file

@ -67,6 +67,21 @@
}
},
"flake-utils": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
@ -80,7 +95,7 @@
"type": "indirect"
}
},
"flake-utils_2": {
"flake-utils_3": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
@ -142,10 +157,29 @@
"type": "github"
}
},
"minecraft-servers": {
"inputs": {
"nixpkgs": "nixpkgs_2",
"utils": "utils_2"
},
"locked": {
"lastModified": 1651222568,
"narHash": "sha256-7qdugZJHKcGIv+KPPTpY7wZhw3pNJ3zR4lVOuf0LduI=",
"owner": "jyooru",
"repo": "nix-minecraft-servers",
"rev": "62fe6124dc65a84144f83cdbdbc2aa4c0a8cc29f",
"type": "github"
},
"original": {
"owner": "jyooru",
"repo": "nix-minecraft-servers",
"type": "github"
}
},
"nix": {
"inputs": {
"lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1633098935,
@ -163,7 +197,7 @@
"nix_2": {
"inputs": {
"lowdown-src": "lowdown-src_2",
"nixpkgs": "nixpkgs_5"
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1633098935,
@ -195,6 +229,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1646506091,
"narHash": "sha256-sWNAJE2m+HOh1jtXlHcnhxsj6/sXrHgbqVNcVRlveK4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3e644bd62489b516292c816f70bf0052c693b3c7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1651233872,
"narHash": "sha256-87MbbcxR/lvRVFp+peNqWBcrbrGFmRlbnzskeZkvuNY=",
@ -210,7 +260,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1632864508,
"narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=",
@ -225,7 +275,7 @@
"type": "indirect"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1632495107,
"narHash": "sha256-4NGE56r+FJGBaCYu3CTH4O83Ys4TrtnEPXrvdwg1TDs=",
@ -239,7 +289,7 @@
"type": "indirect"
}
},
"nixpkgs_5": {
"nixpkgs_6": {
"locked": {
"lastModified": 1632864508,
"narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=",
@ -254,7 +304,7 @@
"type": "indirect"
}
},
"nixpkgs_6": {
"nixpkgs_7": {
"locked": {
"lastModified": 1632495107,
"narHash": "sha256-4NGE56r+FJGBaCYu3CTH4O83Ys4TrtnEPXrvdwg1TDs=",
@ -271,7 +321,8 @@
"root": {
"inputs": {
"deploy-rs": "deploy-rs",
"nixpkgs": "nixpkgs_2",
"minecraft-servers": "minecraft-servers",
"nixpkgs": "nixpkgs_3",
"serokell-nix": "serokell-nix",
"vault-secrets": "vault-secrets"
}
@ -279,10 +330,10 @@
"serokell-nix": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"gitignore-nix": "gitignore-nix",
"nix": "nix",
"nixpkgs": "nixpkgs_4"
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1650983357,
@ -313,12 +364,30 @@
"type": "github"
}
},
"utils_2": {
"inputs": {
"flake-utils": "flake-utils"
},
"locked": {
"lastModified": 1647259887,
"narHash": "sha256-yEkMbEHVO9qydluQ3uHGWX1PkfZhgDKxnd1rhZYZ72w=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "06dba5f3b4fa2cc0bfc98ce9cd6f9a4d8db11d46",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"type": "github"
}
},
"vault-secrets": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils_3",
"nix": "nix_2",
"nixpkgs": "nixpkgs_6"
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1633626134,

View file

@ -10,6 +10,7 @@
nixpkgs.url = "github:NULLx76/nixpkgs/papermc-update-1.18.2-313";
serokell-nix.url = "github:serokell/serokell.nix";
vault-secrets.url = "github:serokell/vault-secrets";
minecraft-servers.url = "github:jyooru/nix-minecraft-servers";
};
outputs =
@ -27,6 +28,9 @@
modules = [
./nixos/common
"${./.}/nixos/hosts/${profile}/configuration.nix"
({ pkgs, ... }: {
nixpkgs.overlays = [ ];
})
] ++ (if lxc then [
"${nixpkgs}/nixos/modules/virtualisation/lxc-container.nix"
./nixos/common/generic-lxc.nix

View file

@ -37,7 +37,7 @@
};
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ (import ../pkgs) ];
nixpkgs.overlays = [ (import ../pkgs) inputs.minecraft-servers.overlay ];
# Limit the systemd journal to 100 MB of disk or the
# last 7 days of logs, whichever happens first.

View file

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ lib, config, pkgs, ... }:
{ lib, config, pkgs, inputs, ... }:
{
imports = [ ];
@ -21,8 +21,13 @@
environment.noXlibs = lib.mkForce false;
networking.firewall.allowedTCPPorts = [ config.services.minecraft-server.serverProperties."rcon.port"];
services.minecraft-server = {
enable = true;
package = pkgs.minecraftServers.purpur_1_18_2;
jvmOpts = "--add-modules=jdk.incubator.vector -Xmx2048M -Xms2048M";
declarative = true;
eula = true;
openFirewall = true;
@ -30,12 +35,14 @@
server-port = 25565;
motd = "blahaj minecraft server!";
white-list = true;
enable-rcon = true;
"timings.enabled" = false;
};
whitelist = {
"0x76" = "5513404a-81a2-4c84-b952-18661b1803e7";
red_shifts = "e0afdee5-e776-49a9-a0cd-c8753faf4255";
iampilot = "4055515e-0567-4610-972e-8e530a5a9ccb";
};
package = pkgs.papermc;
};
}