aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-09-29 12:00:00 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-09-29 12:57:06 +0200
commit6197225e11bc0e664ee6e2a71329cec834aa3511 (patch)
treef3db4819bec40897c54d816acb0468a0f64e2d54
parent9254d3dc86a1ab21ddaea246cb17f68c8a8eb9b5 (diff)
minecraft-server: initmain
-rw-r--r--nix/sources.json12
-rw-r--r--systems/system1/configuration.nix17
2 files changed, 29 insertions, 0 deletions
diff --git a/nix/sources.json b/nix/sources.json
index 1835e4e..94c80ea 100644
--- a/nix/sources.json
+++ b/nix/sources.json
@@ -36,6 +36,18 @@
"url": "https://github.com/NixOS/nixpkgs/archive/84d981bae8b5e783b3b548de505b22880559515f.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
+ "nixpkgs_latest": {
+ "branch": "master",
+ "description": "Nix Packages collection & NixOS",
+ "homepage": "",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "8a39ee33c344795d55c270a5fba8d3c7b8585c0f",
+ "sha256": "1iih6rswd4wlclwrjd5r635x6g81p36ijlj9yxp773p89bqwnsl7",
+ "type": "tarball",
+ "url": "https://github.com/NixOS/nixpkgs/archive/8a39ee33c344795d55c270a5fba8d3c7b8585c0f.tar.gz",
+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
+ },
"nomath-org": {
"branch": "main",
"repo": "git@code.nomath.org:~/nomath-org",
diff --git a/systems/system1/configuration.nix b/systems/system1/configuration.nix
index 5695eb9..b33edbe 100644
--- a/systems/system1/configuration.nix
+++ b/systems/system1/configuration.nix
@@ -104,6 +104,23 @@
# enable agame server
{
services.agame.enable = true;
+ systemd.services.agame.wantedBy = pkgs.lib.mkForce [ ];
+ }
+ # enable minecraft server
+ {
+ services.minecraft-server.enable = true;
+ services.minecraft-server.eula = true;
+ services.minecraft-server.openFirewall = true;
+ services.minecraft-server.declarative = true;
+ services.minecraft-server.package = (import (import ../../nix/sources.nix).nixpkgs_latest {
+ config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "minecraft-server" ];
+ }).pkgs.minecraft-server;
+
+ services.minecraft-server.serverProperties.difficulty = 3;
+ services.minecraft-server.serverProperties.motd = config.services.minecraft-server.package.version;
+
+ services.minecraft-server.whitelist.Alsbach = "9e479252-1c7d-45dc-a6ba-5fb8b659af86";
+ services.minecraft-server.whitelist.elbueblo = "3d0afb8e-3289-4b18-90c6-e113eb636e5b";
}
];
}